tomtimms Posted January 31, 2011 Share Posted January 31, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.