select *
from (case when(t1.bxdw = t2.bxdw) then
select t1.bxdw bxdw,
(t1.zje - t2.zje) pk,
t1.tpfy tpfy,
(t1.yx - t2.tpsm) yx,
t2.tpsm tpsm,
(t1.zje - t2.zje + t1.tpfy) zje else
select t1.bxdw bxdw,
t1.zje pk,
t1.tpfy tpfy,
t1.yx yx,
(t1.yx - t1.yx) tpsm,
(t1.zje + t1.tpfy) zje end
from (select bxdw,
sum(zjje) zje,
count(*) yx,
sum(tpfy) tpfy
from CWXT_JPDG_B_YDXX
group by bxdw) t1,
(select bxdw, sum(zjje) zje, count(*) tpsm
from CWXT_JPDG_B_YDXX
where sftp = 1
group by bxdw) t2
)
在when条件哪里报缺失右括号的错误 请问错误是什么 怎样改正