欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > 数据库 >内容正文

数据库

Mysql判断字符串存在性find_in_set

发布时间:2024/9/19 数据库 45 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Mysql判断字符串存在性find_in_set 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

https://www.jianshu.com/p/b2c1ba0ba34f

FIND_IN_SET(str,strList) str 要查询的字符串 strList 字段名,参数以“,”分隔,如(1,2,6,8) 查询字段(strList)中包含的结果,返回结果null或记录。 find_in_set()和in的区别:in针对所有的的列的 find_in_set()和like的区别:like是看做一个整的字符串了select find_in_set('1','1,2,3,4,5,6'); 1 select find_in_set('2','1,2,3,4,5,6'); 2 select find_in_set('7','1,2,3,4,5,6'); 0 select find_in_set('2','1,21,3,4,5,6'); 0 select find_in_set('1',''); 0 select find_in_set(null,'1,2,3,4,5,6'); null select find_in_set('1',null); null

 

总结

以上是生活随笔为你收集整理的Mysql判断字符串存在性find_in_set的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。