Home >Backend Development >PHP Tutorial >求纯mysql语句实现

求纯mysql语句实现

WBOY
WBOYOriginal
2016-06-23 14:02:00748browse

当前有val字段 数据为 a|b|c

我想把数据虚拟为 |a|b|c| 在用like匹配条件 `val` like '%|a|%'  `val` like '%|c|%'想要结果是匹配出a| 和|c


回复讨论(解决方案)

for example


 SELECT 'Monty!' REGEXP '.*';

for example


 SELECT 'Monty!' REGEXP '.*';

不要正则还有办法吗?

 concat('|',val,'|');

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn