返回顶部

收藏

一条比较SQL

更多
--hjc为记录条数,如果没有记录则没有可比性。否则显示比较值
case when hjc=0 then '-' else CAST(case when (hj-hjc)>0 then '+'+cast((hj-hjc) as varchar) else cast((hj-hjc) as varchar) end as varchar(5000)) end as hj2,
case when hjc=0 then '-'else CAST(CAST(CASE WHEN wfhjc =wfhj  THEN 0 WHEN wfhjc = 0 AND wfhj>0 THEN 100 ELSE (wfhj-wfhjc) * 100.0 / wfhjc END AS DECIMAL(10,2)) as varchar(5000)) end as wfl2,

标签:sql

收藏

0人收藏

支持

0

反对

0

发表评论