Jump to content

LIKE Clause On Joined tables


tomtimms

Recommended Posts

I am trying to do a like clause on a joined table, below is my query.

 

SELECT SQL_CALC_FOUND_ROWS source, id, gross, id32 FROM ( ( SELECT a.source, a.id, a.gross, b.id32  FROM table1 a LEFT JOIN table2 b ON (a.source = b.id32 AND a.id = b.id32) WHERE a.date BETWEEN '2011-01-01' AND '2011-01-05' AND b.id32 LIKE '%201%' GROUP BY a.source,a.id )) AS tmp GROUP BY source,id

 

The query doesn't give an error, however it just takes over 100 seconds to process.  Anyone know what I could do to optimize this? 

Link to comment
https://forums.phpfreaks.com/topic/226232-like-clause-on-joined-tables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.