sql like - MySQL CONCAT in WHERE Statement (Multi Tables) -


my problem pretty simple - @ least hope is. try join 2 tables in mysql , perform statement on concatenated field produce result. here sample query:

select a.name, b.company, concat_ws(' ', a.company, b.name) whole_name   users   inner join company b on a.company_id = b.company_id   having whole_name '%ibm john%'   limit 25 

this query seems still pulling name column , return no results. i've tried doing:

select a.name, b.company, concat_ws(' ', a.company, b.name) whole_name   users   inner join company b on a.company_id = b.company_id   concat_ws(' ', a.company, b.name) '%ibm john%'   limit 25 

and still doesn't yield results. data absolutely in table. company john ibm computer systems. whole_name field return 'ibm computer systems john smith' query on '%ibm john%' return nothing.

any help?

thanks, greg

need % between ibm , john... it's looking "ibm john" somewhere in text... not ibm john somewhere further along..


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -