当先锋百科网

首页 1 2 3 4 5 6 7

oracle中多个case?

select case when substr(a.tel,1,4) in ('1703','1705','1706','1440') then '移动'

when substr(a.tel,1,4) in ('1704','1707','1708','1709') then '联通'

when substr(a.tel,1,4) in ('1410','1700','1701','1702','1349') then '电信'

when substr(a.tel,1,3)('134','135','136','137','138','139','150','151','152','157','158','159','182','183','184','187','188','178','147','198','148') then '移动'

when substr(a.tel,1,3) in ('130','131','132','155','156','185','186','176','145','171','166','146') then '联通'

when substr(a.tel,1,3) in ('133','153','189','180','181','177','173','149','199') then '电信'

end as operator_type

from tb_tel a