Mysql-in查询问题
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