Search code examples
sqlwhere-clausesql-like

Mention more than one coloumn in where cause


I want to do search in my app. Here is a general look of my query

SELECT * FROM My_Table WHERE Col1 OR col or Col3 LIKE "String";

My question is what is the correct syntax for that query. Thanks.


Solution

  • The correct syntax looks like:

    SELECT * FROM My_Table WHERE Col1 LIKE "%String%" OR col  LIKE "%String%" or Col3 LIKE "%String%";