SQL LIKE Function Help
in a mysql table there is a piece of data under POSITIONS column 'TECHNICAL ASSISTANT (ENVIRONMENTAL)'
i have a piece of string 'MANAGER ENVIRONMENTAL ENGINEERING'.
i want a query when issued, this string should match the above.
currently i am using the below query.
But it's not matching. Please help :rolleyes:
SELECT * FROM TABLENAME
WHERE POSITIONS LIKE '%MANAGER ENVIRONMENTAL ENGINEERING%'
OR POSITIONS LIKE '%MANAGER ENVIRONMENTAL ENGINEERING'
OR POSITIONS LIKE 'MANAGER ENVIRONMENTAL ENGINEERING%'
you have to break down the search string into individual words (using your application language, php or whatever)
WHERE positions LIKE '%manager%'
OR positions LIKE '%environmental%'
OR positions LIKE '%engineering%'
Originally Posted by r937
Thank you r937!
btw, my language is php, ill explode the words and feed to the query then.