drbigfresh Posted April 24, 2007 Share Posted April 24, 2007 In the below query, how do I get MySQL to recognize 't1.word' as the same t1.word earlier in the query.... Right now it is literally trying to to look for 't1.word' in the description field and coming back with '0' select t1.word, (select count(*) from feed WHERE description LIKE "%t1.word%") as popularity from watchwords as t1 Thanks! Scott. Link to comment https://forums.phpfreaks.com/topic/48382-referencing-other-fields-in-select-using-like/ Share on other sites More sharing options...
bubblegum.anarchy Posted April 24, 2007 Share Posted April 24, 2007 This may work but the subquery does not know what t1.word is since the subquery is processed first. WHERE description LIKE concat('%', t1.word, '%') Link to comment https://forums.phpfreaks.com/topic/48382-referencing-other-fields-in-select-using-like/#findComment-236579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.