表aa
a b c d e f g1000 0 sdafsadfd sdfsda 500 10 100,102,1000,1020, 0
1001 0 sdafsadfd sdfsda 500 10 100,102,1000,2000, 0
1002 0 sdafsadfd sdfsda 500 10 100,102,1000, 0
传过来个字符串 '100,2000,'意思是包含 '100,' 并且包含 '2000,'的数据sql怎么写 啊应该是查到第二行
a b c d e f g1000 0 sdafsadfd sdfsda 500 10 100,102,1000,1020, 0
1001 0 sdafsadfd sdfsda 500 10 100,102,1000,2000, 0
1002 0 sdafsadfd sdfsda 500 10 100,102,1000, 0
传过来个字符串 '100,2000,'意思是包含 '100,' 并且包含 '2000,'的数据sql怎么写 啊应该是查到第二行
select * from aa where f like '%100%' or f like '%2000%'
--包含100, 并且包含2000, 你的意思是只有第二条数据复合吧。
select * from aa where f like '%100,%2000,%'