Mysql Concat two columns while searching with LIKE

前端 未结 3 2069
攒了一身酷
攒了一身酷 2021-01-07 02:57

I am trying to make a MySQL query where I filter the records based on the search text using LIKE keyword.

For example if the user searches for Illusion Softwar

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-07 03:16

    SELECT *,c.ID as CID 
    FROM Contacts c
    LEFT OUTER JOIN website_Data w ON c.ID=w.ContactID
    WHERE c.Email OR CONCAT_WS(' ',c.FirstName,c.LastName) LIKE '%Illusion Softwares%'
    ORDER BY c.Created DESC;
    

提交回复
热议问题