mga_ka_php Posted May 28, 2008 Share Posted May 28, 2008 select concat(column1,column2) as column3 from table1 where column3 like '%$str%' ??????? coz i want to search in a concatenated column, how do i do that? Link to comment https://forums.phpfreaks.com/topic/107557-solved-what-is-the-correct-sql-statement-for-this/ Share on other sites More sharing options...
Barand Posted May 28, 2008 Share Posted May 28, 2008 select concat(column1,column2) as column3 from table1 where concat(column1,column2) like '%$str%' You can't use an alias in a WHERE clause Link to comment https://forums.phpfreaks.com/topic/107557-solved-what-is-the-correct-sql-statement-for-this/#findComment-551969 Share on other sites More sharing options...
fenway Posted May 29, 2008 Share Posted May 29, 2008 But you can using it a HAVING clause... and sometimes you can. Link to comment https://forums.phpfreaks.com/topic/107557-solved-what-is-the-correct-sql-statement-for-this/#findComment-552698 Share on other sites More sharing options...
mga_ka_php Posted May 31, 2008 Author Share Posted May 31, 2008 wow thanks. Link to comment https://forums.phpfreaks.com/topic/107557-solved-what-is-the-correct-sql-statement-for-this/#findComment-554030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.