select * from table where substr(tel,3,1)<4 联通
select * from table where substr(tel,3,1)>4 移动

解决方案 »

  1.   

    select * from table where substring(tel,3,1)<4 联通
    select * from table where substring(tel,3,1)>4 移动
      

  2.   

    select * from table where substr(tel,3,1)<4 union(
    select * from table where substr(tel,3,1)>4 )
      

  3.   

    select * from table where substring(tel,3,) <4  and substring(tel,1,2)= 13 联通
    select * from table where substring(tel,3,1)>4 and substring(tel,1,2)= 13 移动
      

  4.   

    select *,cast when cast(left(tel,3) as int)<135 then '联通' when cast(left(tel,3) as int)>=135 then '移动' end as type from 表