create table defecttype(defecttype1 nvarchar(20),defecttype2 nvarchar(20),defecttype3 nvarchar(20),defecttype4 nvarchar(20),defecttype5 nvarchar(20),defecttype6 nvarchar(20) ) insert into defecttype values('True','False','True',null,null,null) select a,b,c,d,e,f,(a+b+c+d+e+f) g from (select case defecttype1 when 'True' then '中' else '' end as a , case defecttype2 when 'True' then '国' else '' end as b , case defecttype3 when 'True' then '五' else '' end as c , case defecttype4 when 'True' then '十' else '' end as d , case defecttype5 when 'True' then '六' else '' end as e , case defecttype6 when 'True' then '民' else '' end as f from defecttype ) Z