OK so lets say you have a table with 6 columns and you want to query with a pattern match on 4 columns. How do I do this? I can produce accurate result with 1 column like this: SELECT * FROM tableName WHERE name LIKE '%pattern%' That works with one column like 'name' but if I wanted to query other columns like name,title,comment,ect how would I form this SQL statement? details: MySQL 5.0.77 Al cols are Latin_general_ci Ya I am a newbie with this stuff.....
I am assuming "rus_name" is the next column I am calling on to query? SELECT * FROM table_name WHERE (name LIKE '%you%') AND (title LIKE '%me%') AND (comment LIKE '%el%') Thanks for the reply!
Although this is valid syntax this query using the above format return zero results when it should return 3 user names with 'guy' in their user names. query: SELECT * FROM kwaks WHERE (name LIKE '%guy%') AND (title LIKE '%guy%') AND (comment LIKE '%guy%') Suggestions anyone?
Try OR instead of AND, SELECT * FROM kwaks WHERE (name LIKE '%guy%') OR (title LIKE '%guy%') Or maybe i misunderstood you question ?
but with it u will check for any from all and if i have to check patter in all 3 column then and query is correct. select * from emp where (ename like 'S%') and (job like 'C%'); u will get i column output