Data are as follows:
id col
1 a,b,d
2 a,b,c
My query conditions:
col=(a,b) requires finding two rows with IDs 1 and 2
col=(a,d) Find the row with id 1
col=(a,c) Find the row with id 2
col=(a) Find two rows with IDs 1 and 2
Could you please tell me if you have any methods?
Take the first one as an example.
1.SELECT * FROM test_findisset where find_in_set('a',col) and find_in_set('a',col) and find_in_set('b',col)
2.SELECT * FROM test_findisset where find_in_set('a',col) and find_in_set('a',col) and find_in_set('d',col)
3.SELECT * FROM test_findisset where find_in_set('a',col) and find_in_set('a',col) and find_in_set('c',col)
4.SELECT * FROM test_findisset where find_in_set('a',col) and find_in_set('a',col)