当前位置: 首页 > >

mysql手机号码规律查询

tips:所有手机号均为随机创建的,为了做查询的效果展示,不涉及他人隐私。



mysql手机号码规律查询
tips:所有手机号均为随机创建的,为了做查询的效果展示,不涉及他人隐私。数据库全号规律AAAABABAABBCCABCD(顺子,1234或4321)AAABBB6多8多9多(举例:11位的号码中存在超过6个)
中间规律AAAABABAABBCCABCD(顺子,1234或4321)AAABBB
尾号规律AAAABABAABBCCABCD(顺子,1234或4321)AAABBB



数据库

数据库中的表只使用了一个字段:phone_number


全号规律
AAA

select phone_number from `phone_number` where
(
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,3,1)
and
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,4,1)
)
OR
(
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,5,1)
)
OR
(
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,6,1)
)
OR
(
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
)
OR
(
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,8,1)
)
OR
(
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,9,1)
)
OR
(
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,10,1)
)
OR
(
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,10,1)
and
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,11,1)
)


ABAB

select phone_number from `phone_number` where
(
SUBSTR(phone_number,1,1) != SUBSTR(phone_number,2,1)
and
SUBSTR(phone_number,1,1) = SUBSTR(phone_number,3,1)
AND
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,4,1)
)
or
(
SUBSTR(phone_number,2,1) != SUBSTR(phone_number,3,1)
and
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,4,1)
AND
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,5,1)
)
or
(
SUBSTR(phone_number,3,1) != SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,5,1)
AND
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,6,1)
)
or
(
SUBSTR(phone_number,4,1) != SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,6,1)
AND
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
)
or
(
SUBSTR(phone_number,5,1) != SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
AND
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,8,1)
)
or
(
SUBSTR(phone_number,6,1) != SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,8,1)
AND
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,9,1)
)
or
(
SUBSTR(phone_number,7,1) != SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,9,1)
AND
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,10,1)
)
or
(
SUBSTR(phone_number,8,1) != SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,10,1)
AND
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,11,1)
)


AABBCC

select phone_number from `phone_number` where
(
SUBSTR(phone_number,1,1) != SUBSTR(phone_number,3,1)
and
SUBSTR(phone_number,1,1) != SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,3,1) != SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,1,1) = SUBSTR(phone_number,2,1)
AND
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,4,1)
AND
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
)
or
(
SUBSTR(phone_number,2,1) != SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,2,1) != SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,4,1) != SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,3,1)
AND
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,5,1)
AND
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
)
or
(
SUBSTR(phone_number,3,1) != SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,3,1) != SUBSTR(phone_number,7,1)
AND
SUBSTR(phone_number,5,1) != SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,4,1)
AND
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
AND
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
)
or
(
SUBSTR(phone_number,4,1) != SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,4,1) != SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,6,1) != SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,5,1)
AND
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
AND
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,9,1)
)
or
(
SUBSTR(phone_number,5,1) != SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,5,1) != SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,7,1) != SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
AND
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
AND
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,10,1)
)
or
(
SUBSTR(phone_number,6,1) != SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,6,1) != SUBSTR(phone_number,10,1)
and
SUBSTR(phone_number,8,1) != SUBSTR(phone_number,10,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
AND
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,9,1)
AND
SUBSTR(phone_number,10,1) = SUBSTR(phone_number,11,1)
)


ABCD(顺子,1234或4321)

select phone_number from `phone_number` where
(
(
SUBSTR(phone_number,1,1) = (SUBSTR(phone_number,2,1)+1)
and
SUBSTR(phone_number,2,1) = (SUBSTR(phone_number,3,1)+1)
and
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)+1)
)
OR
(
SUBSTR(phone_number,1,1) = (SUBSTR(phone_number,2,1)-1)
and
SUBSTR(phone_number,2,1) = (SUBSTR(phone_number,3,1)-1)
and
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,2,1) = (SUBSTR(phone_number,3,1)+1)
and
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)+1)
and
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)+1)
)
or
(
SUBSTR(phone_number,2,1) = (SUBSTR(phone_number,3,1)-1)
and
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)-1)
and
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)+1)
and
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)+1)
and
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)+1)
)
OR
(
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)-1)
and
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)-1)
and
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)+1)
and
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)+1)
AND
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)+1)
)
OR
(
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)-1)
and
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)-1)
AND
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)+1)
and
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)+1)
and
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)+1)
)
OR
(
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)-1)
and
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)-1)
and
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)+1)
and
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)+1)
and
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)+1)
)
OR
(
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)-1)
and
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)-1)
and
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)+1)
and
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)+1)
and
SUBSTR(phone_number,9,1) = (SUBSTR(phone_number,10,1)+1)
)
OR
(
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)-1)
and
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)-1)
and
SUBSTR(phone_number,9,1) = (SUBSTR(phone_number,10,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)+1)
and
SUBSTR(phone_number,9,1) = (SUBSTR(phone_number,10,1)+1)
AND
SUBSTR(phone_number,10,1) = (SUBSTR(phone_number,11,1)+1)
)
OR
(
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)-1)
and
SUBSTR(phone_number,9,1) = (SUBSTR(phone_number,10,1)-1)
AND
SUBSTR(phone_number,10,1) = (SUBSTR(phone_number,11,1)-1)
)
)


AAABBB

select phone_number from `phone_number` where
(
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,3,1)
and
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
)
OR
(
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,8,1)
)
OR
(
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,9,1)
)
OR
(
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,10,1)
)
OR
(
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,10,1)
and
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,11,1)
)


6多8多9多(举例:11位的号码中存在超过6个)

tips:这里采用了一种比较巧妙的方式. 将存在6的号码替换为空,将11位减去替换后的长度就是6出现的个数.以此类推,将6的个数+8的个数+9的个数


select phone_number from `phone_number` where
(
(LENGTH(phone_number) - LENGTH(REPLACE(phone_number,"6",""))) +
(LENGTH(phone_number) - LENGTH(REPLACE(phone_number,"8",""))) +
(LENGTH(phone_number) - LENGTH(REPLACE(phone_number,"9","")))
)>6


中间规律
AAA

select phone_number from `phone_number` where
(
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,3,1)
and
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,4,1)
)
OR
(
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,5,1)
)
OR
(
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,6,1)
)
OR
(
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
)
OR
(
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,8,1)
)
OR
(
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,9,1)
)
OR
(
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,10,1)
)


ABAB

select phone_number from `phone_number` where
(
SUBSTR(phone_number,1,1) != SUBSTR(phone_number,2,1)
and
SUBSTR(phone_number,1,1) = SUBSTR(phone_number,3,1)
AND
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,4,1)
)
or
(
SUBSTR(phone_number,2,1) != SUBSTR(phone_number,3,1)
and
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,4,1)
AND
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,5,1)
)
or
(
SUBSTR(phone_number,3,1) != SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,5,1)
AND
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,6,1)
)
or
(
SUBSTR(phone_number,4,1) != SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,6,1)
AND
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
)
or
(
SUBSTR(phone_number,5,1) != SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
AND
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,8,1)
)
or
(
SUBSTR(phone_number,6,1) != SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,8,1)
AND
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,9,1)
)
or
(
SUBSTR(phone_number,7,1) != SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,9,1)
AND
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,10,1)
)


AABBCC

select phone_number from `phone_number` where
(
SUBSTR(phone_number,1,1) != SUBSTR(phone_number,3,1)
and
SUBSTR(phone_number,1,1) != SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,3,1) != SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,1,1) = SUBSTR(phone_number,2,1)
AND
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,4,1)
AND
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
)
or
(
SUBSTR(phone_number,2,1) != SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,2,1) != SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,4,1) != SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,3,1)
AND
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,5,1)
AND
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
)
or
(
SUBSTR(phone_number,3,1) != SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,3,1) != SUBSTR(phone_number,7,1)
AND
SUBSTR(phone_number,5,1) != SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,4,1)
AND
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
AND
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
)
or
(
SUBSTR(phone_number,4,1) != SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,4,1) != SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,6,1) != SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,5,1)
AND
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
AND
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,9,1)
)
or
(
SUBSTR(phone_number,5,1) != SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,5,1) != SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,7,1) != SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
AND
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
AND
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,10,1)
)


ABCD(顺子,1234或4321)

select phone_number from `phone_number` where
(
(
SUBSTR(phone_number,1,1) = (SUBSTR(phone_number,2,1)+1)
and
SUBSTR(phone_number,2,1) = (SUBSTR(phone_number,3,1)+1)
and
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)+1)
)
OR
(
SUBSTR(phone_number,1,1) = (SUBSTR(phone_number,2,1)-1)
and
SUBSTR(phone_number,2,1) = (SUBSTR(phone_number,3,1)-1)
and
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,2,1) = (SUBSTR(phone_number,3,1)+1)
and
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)+1)
and
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)+1)
)
or
(
SUBSTR(phone_number,2,1) = (SUBSTR(phone_number,3,1)-1)
and
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)-1)
and
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)+1)
and
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)+1)
and
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)+1)
)
OR
(
SUBSTR(phone_number,3,1) = (SUBSTR(phone_number,4,1)-1)
and
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)-1)
and
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)+1)
and
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)+1)
AND
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)+1)
)
OR
(
SUBSTR(phone_number,4,1) = (SUBSTR(phone_number,5,1)-1)
and
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)-1)
AND
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)+1)
and
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)+1)
and
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)+1)
)
OR
(
SUBSTR(phone_number,5,1) = (SUBSTR(phone_number,6,1)-1)
and
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)-1)
and
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)+1)
and
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)+1)
and
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)+1)
)
OR
(
SUBSTR(phone_number,6,1) = (SUBSTR(phone_number,7,1)-1)
and
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)-1)
and
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)-1)
)
)
OR
(
(
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)+1)
and
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)+1)
and
SUBSTR(phone_number,9,1) = (SUBSTR(phone_number,10,1)+1)
)
OR
(
SUBSTR(phone_number,7,1) = (SUBSTR(phone_number,8,1)-1)
and
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)-1)
and
SUBSTR(phone_number,9,1) = (SUBSTR(phone_number,10,1)-1)
)
)


AAABBB

select phone_number from `phone_number` where
(
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,3,1)
and
SUBSTR(phone_number,2,1) = SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
)
OR
(
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,4,1)
and
SUBSTR(phone_number,3,1) = SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,8,1)
)
OR
(
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,5,1)
and
SUBSTR(phone_number,4,1) = SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,9,1)
)
OR
(
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,6,1)
and
SUBSTR(phone_number,5,1) = SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,10,1)
)



尾号规律
AAA

select phone_number from `phone_number` where
(
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,10,1)
and
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,11,1)
)


ABAB

select phone_number from `phone_number` where
(
SUBSTR(phone_number,8,1) != SUBSTR(phone_number,9,1)
and
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,10,1)
AND
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,11,1)
)


AABBCC

select phone_number from `phone_number` where
(
SUBSTR(phone_number,6,1) != SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,6,1) != SUBSTR(phone_number,10,1)
and
SUBSTR(phone_number,8,1) != SUBSTR(phone_number,10,1)
and
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
AND
SUBSTR(phone_number,8,1) = SUBSTR(phone_number,9,1)
AND
SUBSTR(phone_number,10,1) = SUBSTR(phone_number,11,1)
)


ABCD(顺子,1234或4321)

select phone_number from `phone_number` where
(
(
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)+1)
and
SUBSTR(phone_number,9,1) = (SUBSTR(phone_number,10,1)+1)
AND
SUBSTR(phone_number,10,1) = (SUBSTR(phone_number,11,1)+1)
)
OR
(
SUBSTR(phone_number,8,1) = (SUBSTR(phone_number,9,1)-1)
and
SUBSTR(phone_number,9,1) = (SUBSTR(phone_number,10,1)-1)
AND
SUBSTR(phone_number,10,1) = (SUBSTR(phone_number,11,1)-1)
)
)


AAABBB

select phone_number from `phone_number` where
(
SUBSTR(phone_number,6,1) = SUBSTR(phone_number,7,1)
and
SUBSTR(phone_number,7,1) = SUBSTR(phone_number,8,1)
and
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,10,1)
and
SUBSTR(phone_number,9,1) = SUBSTR(phone_number,11,1)
)



友情链接: year2525网 工作范文网 QS-ISP 138资料网 528200 工作范文网 baothai 表格模版