hello all I have come across a unique situation i cant figure out how to resolve.
i have table here:
---------
|id|data|
|1|cat-dog-bird|
|2|dog-cat-bird|
|3|cat-man-dog|
---------------
how can i make it so
if query is like select * where data == cat-dog-bird or dog-cat-bird or bird-dog-cat
the record ids returned would be 1,and 2 but not id 3.
you see what i mean like a regex separated by a delimiter,
this would probably be more efficient to do in the database eh? anyhow im lost.
Page 1 of 1
sql query/relation problem
#2
Posted 20 April 2010 - 02:27 AM
SELECT * FROM `table` WHERE FIND_IN_SET(data,'cat-dog-bird,dog-cat-bird,bird-dog-cat') > 0;
#4
Posted 21 April 2010 - 02:07 AM
It works with varchar columns too.
Simply if the column is a SET, the function is optimized.
Simply if the column is a SET, the function is optimized.
Share this topic:
Page 1 of 1

Help















