opposite of LIKE "%foo%"
SELECT * FROM table WHERE foo LIKE "%barbarbar%"
will contain rows where foo contains "barbarbar"
=> for example where foo is "barbarbarbarbar"
What I want, are the rows where "barbarbar" contains foo
=> for example where foo is "barbar"
how to do it?
would you please rephrase the question?
Originally Posted by godisatheist
which of those is the column? and which is the constant?
foo is always the coloumn in this example.
I think I found an possible solution:
SELECT * FROM table WHERE "barbarbar" LIKE CONCAT('%' , foo , '%')