mysql好用的函数

 FIND_IN_SET

用法示意:
      
INSERT INTO `test` VALUES (1, 'name', 'daodao,xiaohu,xiaoqin');
INSERT INTO `test` VALUES (2, 'name2', 'xiaohu,daodao,xiaoqin');
INSERT INTO `test` VALUES (3, 'name3', 'xiaoqin,daodao,xiaohu');
 
 
test1:sql = select * from `test` where 'daodao' IN (`list`);
得到结果空值.
test2:sql = select * from `test` where FIND_IN_SET('daodao',`list`);
得到三条数据

  

posted @ 2019-03-04 18:41  rianley  阅读(260)  评论(0编辑  收藏  举报