题解 | 找到特殊的电话号码

找到特殊的电话号码

https://www.nowcoder.com/practice/cfb479bf0f5f4251afc536ddb12d1f32

select
    distinct t.电话号码
from
    (select
        电话号码,
        substr(电话号码,5,1) as d5,
        substr(电话号码,6,1) as d6,
        substr(电话号码,7,1) as d7,
        substr(电话号码,8,1) as d8
    from
        电话费用表
    where
        月份 between 201701 and 201710) t
where 
    t.d5 between 1 and 9
    and t.d6 between 1 and 9
    and t.d7 between 1 and 9
    and t.d8 between 1 and 9
    and ((d5 = d6 and d7 = d8)
    or (d5 = d7 and d6 = d8)
    or (d5 = d6 = d7 = d8))

全部评论

相关推荐

11-04 19:05
已编辑
东莞城市学院 单片机
不知道怎么取名字_:你这个要实习两年?哪有这么久的,感觉就是即使你毕业了,但还按实习的话,是不是不用给你缴社保公积金啥的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务