Mysql-in查询问题

标签(空格分隔): mysql

问题:mysql用in语法查询出来的数据少了好多!

我的实际情况:
数据表:
    content字段记录着一些选项的id,多个选项用逗号隔开,比如要查询content字段中有29的记录.

in 查询:

    select * from t_investigate_record where investigate_id = 10001 and answer_id = 6 and content in (29) order by id 

find_in_set() 查询:

    select * from t_investigate_record where investigate_id = 10001 and answer_id = 6 and find_in_set(29, content) order by id 

版权声明:本文为yanweifeng原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/yanweifeng/p/10250324.html