gpt4 book ai didi

MySQL RLIKE 缺失信息

转载 作者:行者123 更新时间:2023-11-29 23:59:29 28 4
gpt4 key购买 nike

SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[0-9]'

上面的命令将收集 A =1 和 B 中从数字 0 到 9 的数据。例如,它将收集 111,112,113,114 等。但是,与将其分成 RLIKE ' 相比,上面的命令总是会丢失一些数据^[0]'、RLIKE '^[1]'等,如下所示。

SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[0]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[1]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[2]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[3]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[4]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[5]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[6]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[7]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[8]'
SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[9]'

在上面的例子中,

SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[1]'

它将始终收集 111,112,113,114,115,121,其中“115”和“121”是“SELECT * FROM A, B, C, D WHERE A = 1 AND B RLIKE '^[0-9]'”看不到的额外内容。使用 REGEXP 将得到相同的结果。请问有什么意见吗?谢谢。

We are using MySQL 5.1.39.   

最佳答案

应该没有区别。你能给我确切的查询吗?上面的查询格式错误,很难定位为什么 115 和 121 没有被选中。

关于MySQL RLIKE 缺失信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25145998/

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