mysql查询中的正则表达式 [英] regular expression in mysql query
本文介绍了mysql查询中的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有类似mysql表的值
I have mysql table values like
1-2
1-2-3
1-4-5
1-4-5-12-15
15-45-75
1-5-15-25-35-55
55-65-75
我想选择编号为5(而不是15、25或35)的行.
I want to select which rows have number 5(not 15 or 25 or 35).
我尝试过使用LIKE查询,但是它给出了所有5个值包含行(包括15、35、45、55).
I have tried with LIKE query but it gives all 5 value contains rows(including 15, 35, 45,55).
SELECT ... WHERE linkage LIKE '%5%'
我认为我们可以通过REGEXP做到.你能帮我吗?
I think we can do it through REGEXP. Can you help me for it?
推荐答案
您可以使用 查看全文