Select datas from mysql where column value contains two strings
Posted: 09 Jan 2015, 06:48
I want to search in mysql database with columns containing some specified names and the column has values like:
"Varsus GmbH (default)"
"Varsus Feinmechanik"
"Varsus xyz-something"
I need to get the result as an array where it contains results with columns containing exactly equal to "Varsus", if not then check for both "Varsus" and "default".
How to write a mysql query like this.
Now I've tried some thing like this:
I need some thing like:
"Varsus GmbH (default)"
"Varsus Feinmechanik"
"Varsus xyz-something"
I need to get the result as an array where it contains results with columns containing exactly equal to "Varsus", if not then check for both "Varsus" and "default".
How to write a mysql query like this.
Now I've tried some thing like this:
Code: Select all
SELECT * FROM table WHERE suppliername = 'Bansbach'
Code: Select all
WHERE if(suppliername !='Bansbach' then (check it contains both Varsus and default) )