SQL Like question

Posted by mike on Stack Overflow See other posts from Stack Overflow or by mike
Published on 2010-04-20T02:08:36Z Indexed on 2010/04/20 2:13 UTC
Read the original article Hit count: 350

Filed under:
|
|

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

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

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

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

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

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql