SQL Like question

Is there a way to flip the SQL Like statement so that it searches the field backwards? For example, I have a value in a field that looks like "Xbox 360 Video Game". If I write a query like below it returns the result.

SELECT id FROM table WHERE title like "%Xbox%Game%"

      

However, when I search this way, it doesn't find any results.

SELECT id FROM table WHERE title like "%Video%Xbox%"

      

I need it to fit in any direction. How can I get around this?

+2


a source to share


2 answers


Another variant



SELECT id FROM table WHERE title RLIKE "(Xbox|Video)"

      

+5


a source


What about:



SELECT id FROM table WHERE title, such as "% Video%" and a title, such as "% Xbox%"

+7


a source







All Articles