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. Quote 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, '%') Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.