L
lgzh_3
Unregistered / Unconfirmed
GUEST, unregistred user!
select n.fzr,n.zpzs,n,clzs,n.zjl,m.clsl,m.dqsl,m.nsl
from
(select c.fzr as fzr,iif(c.zpzs is null,0,c.zpzs) as zpzs,
iif(d.cls is null,0,d.cls) as clzs,
iif(zpzs=0,100,clzs*100/zpzs) as zjl
from
(select clxx.fzr,count(clxx.clhp) as zpzs from clxx,zpxx where clxx.clhp=zpxx.cph group by clxx.fzr) c left join
(select clxx.fzr,count(clxx.clhp) as cls from clxx,zpxx where clxx.clhp=zpxx.cph and zpxx.sfcl='是' group by clxx.fzr) d
on c.fzr=d.fzr) n,
(select a.fzr as fzr,iif(a.clsl is null,0,a.clsl) as clsl,
iif(b.dqsl is null,0,b.dqsl) as dqsl,
iif(clsl-0,100,(a.clsl-b.dqsl)*100/a.clsl) as nsl
from
(select fzr,count(*) as clsl from clxx group by fzr) a,
(select fzr,count(*) as dqsl from clxx where nsrq<now() group by fzr) b
where a.fzr=b.fzr) m
where n.fzr=m.fzr;
from
(select c.fzr as fzr,iif(c.zpzs is null,0,c.zpzs) as zpzs,
iif(d.cls is null,0,d.cls) as clzs,
iif(zpzs=0,100,clzs*100/zpzs) as zjl
from
(select clxx.fzr,count(clxx.clhp) as zpzs from clxx,zpxx where clxx.clhp=zpxx.cph group by clxx.fzr) c left join
(select clxx.fzr,count(clxx.clhp) as cls from clxx,zpxx where clxx.clhp=zpxx.cph and zpxx.sfcl='是' group by clxx.fzr) d
on c.fzr=d.fzr) n,
(select a.fzr as fzr,iif(a.clsl is null,0,a.clsl) as clsl,
iif(b.dqsl is null,0,b.dqsl) as dqsl,
iif(clsl-0,100,(a.clsl-b.dqsl)*100/a.clsl) as nsl
from
(select fzr,count(*) as clsl from clxx group by fzr) a,
(select fzr,count(*) as dqsl from clxx where nsrq<now() group by fzr) b
where a.fzr=b.fzr) m
where n.fzr=m.fzr;