MySql: Select operator using IN operator
I have a table with multiple fields and one field with three comma separated values
Column 1 Column 2
1 1,2,3
2 2,3,4
3 6,7,8
Now I want to run a SQL query that fetches me rows that have a value that I am sending as input.
As in the example above, if I send the value 2 as input to the function, it should return the 1st 2 lines.
I tried to use the IN operator but couldn't, as it doesn't fetch rows that have an i input, which you send as 2nd or 3rd CSV value. In this example, it does not return the 1st row.
Can someone please help me with this?
Thanks, Advance, Akasha
+1
Akash
a source
to share
3 answers