DB is MySQL. There is one table which structure is showed below:
select * from table1
id column1
-- --------
1 3,4,5
2 3,7,8
And sql which is not working correctly:
SELECT * FROM table1 WHERE 3 in (column1)
I know that the structure of the table is not right. But it was done before me. What can you suggest me in this way? or something that will perform the meaning of this sql? Thanks.
Please normalize your table. Read why storing comma separated values in a db column is really bad.
If you are not allowed to, use
FIND_IN_SET()function: