仪器社区

sql 把科室编码里包括B的字符全换成C字符

等哈我才123 2018-06-18
sql 把科室编码里包括B的字符全换成C字符是replace(B%,B,C)还是replace(科室编码,B,C)
评论
全部评论
lifeup伊利
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
8 0 2018-06-19 0条评论 回复
cdsqaz
replace(科室编码,B,C).
6 0 2018-06-19 0条评论 回复
您可能感兴趣的社区主题
加载中...
发布 评论