I have 2 strings that are not ordered for example orange
is not always at second place in first line or other values.
apple, orange, water
water, juice, orange, something, apple
I want TRUE if all first line values exist in second line.
I've tried
REGEXP 'apple|orange|water'
but|
isor
notand
that it gives me true ifone of them
exists there notall of them
unless I write every possible sort.I've also tried
IN()
but it needs 3 statements like :... 'apple' IN('water', 'juice', 'orange', 'something', 'apple') AND 'orange' IN('water', 'juice', 'orange', 'something', 'apple') AND 'water' IN('water', 'juice', 'orange', 'something', 'apple') ...
Also tried
LIKE
but it should be likeIN()
in making queries.I tried
Match() Against()
after all, but it doesn't work injoin
statement. look at this:SELECT * FROM t1 INNER JOIN t2 ON t1.sth = t2.sth AND MATCH(t1.sthelse) AGAINST(t2.sthelse IN BOOLEAN MODE)
There's 2 problems here. First, it doesn't work in join (also used
where
but second problem not solved. Second,AGAINST
should be string :-? WithConcat()
I couldn't do the trick the error exists.
I want to do it not in these hard ways and also for my purpose, I should do it with mysql and cannot access php for manipulating these data. + I can change split character to anything.
Any idea... Appreciated.