MySQL Search Query on two different fields

Posted by user181677 on Stack Overflow See other posts from Stack Overflow or by user181677
Published on 2010-03-18T11:22:08Z Indexed on 2010/03/18 11:31 UTC
Read the original article Hit count: 300

Filed under:
|

I need to search on two fields using LIKE function and should match also in reverse order. My table uses InnoDB which dont have Full text search.

For example, I have users table with first_name and last_name column.

I tried this SQL statement but no luck.

SELECT CONCAT(first_name, ' ', last_name) as fullname 
  FROM users 
 WHERE fullname LIKE '%doe%';

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query