mysql find_in_set斜杠(/)分隔符 [英] Mysql find_in_set slash( / ) separator

查看:2625
本文介绍了mysql find_in_set斜杠(/)分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的值是:
1/2
3/4/5
2/3/6

I have a value of:
1/2
3/4/5
2/3/6

我想找到值2,所以结果必须是
1/2
2/3/6

I want to find the value 2 so the result must be
1/2
2/3/6

我不想使用LIKE运算符. 有什么方法可以在FIND_IN_SET函数中设置分隔符?

I dont want to use LIKE operator. Is there any way to set the separator in FIND_IN_SET function?

推荐答案

您可以使用likefind_in_set().这是一种方法:

You can use like or find_in_set(). Here is one method:

where find_in_set(2, replace(col, '/', ',')) > 0

这篇关于mysql find_in_set斜杠(/)分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆