gpt4 book ai didi

mysql - 将mysql正则表达式拆分为多行

转载 作者:行者123 更新时间:2023-11-29 06:37:25 25 4
gpt4 key购买 nike

我有一个很长的 MySQL 正则表达式查询,我想将其拆分为多行,但我还不知道如何拆分。
简短版:
select * from table.ips where ipip not regexp '^4\.|^8\.|^12\.|^18\.'按ipID排序;

多行非工作版本:

select * from table.ips where ipip not regexp '

^4\\.|

^8\\.|

^12\\.|

^18\\.

' order by ipID;

提前致谢。

最佳答案

我认为 mysql 正则表达式中没有自由间距模式...

如何使用 CONCAT

select * from table.ips where ipip not regexp concat(
'^4\\.|',
'^8\\.|',
'^12\\.|',
'^18\\.'
)

关于mysql - 将mysql正则表达式拆分为多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23662689/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com