select oligo_id, tag_ids from wjl_oligo where tag_ids REGEXP '(^|,)5($|,)';
2 3,5
3 5,6
5 3,5,7
7 5,15
10 5
13 3,5,6
14 3,5,7,8
用find_in_set函数
select * from 数据表名 where find_in_set('16',youruser_id);
select * from xxx表 where find_in_set('16',youruser_id);
find_in_set返回的是前字符在后字符里的位置
查询2 是否是2,3,4 里面,,数据库存储为 ,2,3,4,
用like查询,where里条件 "%,"(拼接要查询的值)",%"
学开发时间较短,临时想的一个办法。
教你个猥琐的办法
插入数据的时候,不管是一个还是多个,最后都加个逗号
这样就不会有问题了
查询寻的时候,查2,