日期:2014-05-17 浏览次数:20505 次
select (case when clinic_label LIKE '%门诊' then '门诊' else '急诊' END)as a
from fact_clinic_master
--方法1,你的写法,稍微改一下就对了哈
select
case when clinic_label like'%门诊' then '门诊'
else '急诊' end as a
from fact_clinic_master
--方法2
select
case when charindex('门诊',clinic_label) >0 then '门诊'
else '急诊' end as a
from fact_clinic_master
select case when clinic_label LIKE '%门诊' then '门诊' else '急诊' END as a
from fact_clinic_master