公式列试试 total=isnull(a1,'')+ case when a2 is null then '' else '/'+a2 end+ case when a3 is null then '' else '/'+a3 end+ case when a4 is null then '' else '/'+a4 end+ case when a5 is null then '' else '/'+a5 end
select isnull(A1+'/','')+ isnull(A2+'/','')+ isnull(A3+'/','')+ isnull(A4+'/','')+ isnull(A5+'/','') from A
total=isnull(a1,'')+
case when a2 is null then '' else '/'+a2 end+
case when a3 is null then '' else '/'+a3 end+
case when a4 is null then '' else '/'+a4 end+
case when a5 is null then '' else '/'+a5 end
isnull(A2+'/','')+
isnull(A3+'/','')+
isnull(A4+'/','')+
isnull(A5+'/','')
from A
如入下列数据:
Total
--------------------------------------------------------------------
操作规程/佩戴防护用品/ 这里的/其实不用
配发劳保用品、健康教育、定期体检/佩戴防护用品/
配发劳保用品、健康教育、定期体检/佩戴防护用品/
操作规程/因工重伤及以上事故为零,因工轻伤人数不超过3‰/
操作规程/职业健康安全环境管理目标指标/
定期检查/设备作业指导书
--------------------------------------------------------------------
isnull(A2+'/','')+
isnull(A3+'/','')+
isnull(A4+'/','')+
isnull(A5,'')
from tb
from tb