Pages

Sunday, August 18, 2013

MYSQL-Find a word from comma separated list(in string)

I have a table as follows

id name status
1  test1  option1,option2
2  test2  option,option1
3  test3  option2,option3
4  test4  option3,option4
5  test5  option1,option3

"SELECT * FROM TABLE WHERE FIND_IN_SET('option',status-name of column/attribute)">0

simple query to check whether a string is present in comma separated values entered as string under a column or attribute

1 comment: