I have a table named “MYprojects” and a column named with “Rights”.Now i have a following row
id =>1
rights => 7,4,34,532,12,32
Now i need to delete that row if any of the number-in rights column presents in the following
value
2,4,65,34
As you can see 4 is present in the value in the column so i need to delete that row.
Can someone tell me the mysql query or function for this?
It can be done by server side scripting by applying loops but i need an optimized solution
Thanks
You could use MySQL’s
FIND_IN_SET()function (which will be particularly efficient if theRightscolumn is stored using theSETdata-type):However, as daghan comments, you should probably consider a more suitable datastructure that takes advantage of MySQL’s relational database management capabilities.