日期:2014-05-17 浏览次数:20504 次
create table 电话费用表(tel_no varchar(30), cost int)
insert into 电话费用表
select '13800000000' ,38 union all
select '13823400000' ,56 union all
select '13800056400' ,88 union all
select '13800230000' ,28 union all
select '13802300000' ,18 union all
select '13822220000' ,68 union all
select '13844400000' ,98 union all
select '13833330000' ,35 union all
select '13822220000' ,31 union all
select '13811110000' ,32
go
select tel_no as 电话号码,
case when tel_no in ('13800000000','13823400000','13800056400','13800230000','13802300000')
then '行政部'
when tel_no in ('13822220000','13844400000')
then '财务部'
when tel_no in ('13833330000','13822220000','13811110000')
then '销售部'
end as 部门 ,