开发者

MYSQL: condition _IN_ doesn't work correct

开发者 https://www.devze.com 2023-03-01 14:01 出处:网络
So I have column \'CLM\' in the table where one record has follow value: \'4,6,1\'. I do follow select:

So I have column 'CLM' in the table where one record has follow value: '4,6,1'.

I do follow select: SELECT * FROM table WHERE 6 IN (CLM) got nothing then.

I do follow select: SELECT * FROM table WHERE 4 IN (CLM) got record described behind.

Cannot understand why first query works wro开发者_如何学运维ng?


You have to use find_in_set function even though it would be better you normalize your table as already suggested.

0

精彩评论

暂无评论...
验证码 换一张
取 消