当前位置: 代码迷 >> SQL >> sqlserver话语
  详细解决方案

sqlserver话语

热度:126   发布时间:2016-05-05 14:01:35.0
sqlserver语句
select rtrim(Kmdm) as Kmdm,	rtrim(Fzhs) as Fzhs,	rtrim(Yefx) as Yefx,	rtrim(Kmlb) as Kmlb,    '${annual}' as annual,    '${ACCOUNT_CODE}' as ACCOUNT_CODE,	kmxz,rtrim(kmmc) as kmmc,zjm,	'1'+kmxz+'00' as code_type,	'0' as ENABLED,'0' as STATE,    (case 		when len(rtrim(Kmdm))=3 then '000'		when len(rtrim(Kmdm))>3 then substring(rtrim(Kmdm),1,len(rtrim(Kmdm))-2)	end) as parent_code,     (select count(1) from gl_kmxx b where rtrim(b.kmdm) like rtrim(a.Kmdm) + '%' ) as is_subfrom gl_kmxx a where gsdm=''
  相关解决方案