1
select xmno,(select xmbm from xmb where no=xmno) as xmbm,(select xmmc from xmb where no=xmno) as xmmc,(select jdmc from jdb where jdb.jddm=(select jddm from xmb where no=xmno)) as jdmc,(select sj1 from xmb where no=xmno) as sj1,(select sj2 from xmb where no=xmno) as sj2,
2
(sum(f011+f012+f013+f014+f021+f022+f023+f024+f031+f032+f033+f034+f041+f042+f043+f044+f051+f052+f053+f054+
3
f061+f062+f063+f064+f071+f072+f073+f074+f081+f082+f083+f084+f091+f092+f093+f094+f101+f102+f103+f104+f111+
4
f112+f113+f114+f121+f122+f123+f124)+
5
(select sum(f011+f012+f013+f014+f021+f022+f023+f024+f031+f032+f033+f034+f041+f042+f043+f044+f051+f052+f053+f054+
6
f061+f062+f063+f064+f071+f072+f073+f074+f081+f082+f083+f084+f091+f092+f093+f094+f101+f102+f103+f104+f111+f112+
7
f113+f114+f121+f122+f123+f124) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as total,
8
(sum(f011+f021+f031+f041+f051+f061+f071+f081+f091+f101+f111+f121)+(select sum(f011+f021+f031+f041+f051+f061+f071+f081+f091+f101+f111+f121) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as zcgs,
9
(sum(f012+f022+f032+f042+f052+f062+f072+f082+f092+f102+f112+f122)+(select sum(f012+f022+f032+f042+f052+f062+f072+f082+f092+f102+f112+f122) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as jbgs,
10
(sum(f013+f023+f033+f043+f053+f063+f073+f083+f093+f103+f113+f123)+(select sum(f013+f023+f033+f043+f053+f063+f073+f083+f093+f103+f113+f123) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as wygs,
11
(sum(f014+f024+f034+f044+f054+f064+f074+f084+f094+f104+f114+f124)+(select sum(f014+f024+f034+f044+f054+f064+f074+f084+f094+f104+f114+f124) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as ccgs,
12
((select sum(f011+f012+f013+f014+f021+f022+f023+f024+f031+f032+f033+f034+f041+f042+f043+f044+f051+f052+f053+f054+
13
f061+f062+f063+f064+f071+f072+f073+f074+f081+f082+f083+f084+f091+f092+f093+f094+f101+f102+f103+f104+f111+
14
f112+f113+f114+f121+f122+f123+f124) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+
15
(select sum(f011+f012+f013+f014+f021+f022+f023+f024+f031+f032+f033+f034+f041+f042+f043+f044+f051+f052+f053+f054+
16
f061+f062+f063+f064+f071+f072+f073+f074+f081+f082+f083+f084+f091+f092+f093+f094+f101+f102+f103+f104+f111+f112+
17
f113+f114+f121+f122+f123+f124) from lsgDwtj2006 where lsgDwtj2006.xmno=a.xmno and obs like 'EA%')
18
) as ea00total,
19
((select sum(f011+f021+f031+f041+f051+f061+f071+f081+f091+f101+f111+f121) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+
20
(select sum(f011+f021+f031+f041+f051+f061+f071+f081+f091+f101+f111+f121) from lsgdwtj2006 where lsgDwtj2006.xmno=a.xmno)) as ea00zcgs,
21
((select sum(f012+f022+f032+f042+f052+f062+f072+f082+f092+f102+f112+f122) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+
22
(select sum(f012+f022+f032+f042+f052+f062+f072+f082+f092+f102+f112+f122) from lsgDwtj2006 where lsgDwtj2006.xmno=a.xmno and obs like 'EA%')) as ea00jbgs,
23
((select sum(f013+f023+f033+f043+f053+f063+f073+f083+f093+f103+f113+f123) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+
24
(select sum(f013+f023+f033+f043+f053+f063+f073+f083+f093+f103+f113+f123) from lsgDwtj2006 where lsgDwtj2006.xmno=a.xmno and obs like 'EA%')) as ea00wygs,
25
((select sum(f014+f024+f034+f044+f054+f064+f074+f084+f094+f104+f114+f124) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+
26
(select sum(f014+f024+f034+f044+f054+f064+f074+f084+f094+f104+f114+f124) from lsgDwtj2006 where lsgDwtj2006.xmno=a.xmno and obs like 'EA%')) as ea00ccgs
27
28
from rytj2006 a group by xmno
29
30
31
select xmno,(select xmbm from xmb where no=xmno) as xmbm,(select xmmc from xmb where no=xmno) as xmmc,(select jdmc from jdb where jdb.jddm=(select jddm from xmb where no=xmno)) as jdmc,(select sj1 from xmb where no=xmno) as sj1,(select sj2 from xmb where no=xmno) as sj2,2
(sum(f011+f012+f013+f014+f021+f022+f023+f024+f031+f032+f033+f034+f041+f042+f043+f044+f051+f052+f053+f054+3
f061+f062+f063+f064+f071+f072+f073+f074+f081+f082+f083+f084+f091+f092+f093+f094+f101+f102+f103+f104+f111+4
f112+f113+f114+f121+f122+f123+f124)+5
(select sum(f011+f012+f013+f014+f021+f022+f023+f024+f031+f032+f033+f034+f041+f042+f043+f044+f051+f052+f053+f054+6
f061+f062+f063+f064+f071+f072+f073+f074+f081+f082+f083+f084+f091+f092+f093+f094+f101+f102+f103+f104+f111+f112+7
f113+f114+f121+f122+f123+f124) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as total,8
(sum(f011+f021+f031+f041+f051+f061+f071+f081+f091+f101+f111+f121)+(select sum(f011+f021+f031+f041+f051+f061+f071+f081+f091+f101+f111+f121) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as zcgs,9
(sum(f012+f022+f032+f042+f052+f062+f072+f082+f092+f102+f112+f122)+(select sum(f012+f022+f032+f042+f052+f062+f072+f082+f092+f102+f112+f122) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as jbgs,10
(sum(f013+f023+f033+f043+f053+f063+f073+f083+f093+f103+f113+f123)+(select sum(f013+f023+f033+f043+f053+f063+f073+f083+f093+f103+f113+f123) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as wygs,11
(sum(f014+f024+f034+f044+f054+f064+f074+f084+f094+f104+f114+f124)+(select sum(f014+f024+f034+f044+f054+f064+f074+f084+f094+f104+f114+f124) from lsgRytj2006 where lsgRytj2006.xmno=xmno)) as ccgs,12
((select sum(f011+f012+f013+f014+f021+f022+f023+f024+f031+f032+f033+f034+f041+f042+f043+f044+f051+f052+f053+f054+13
f061+f062+f063+f064+f071+f072+f073+f074+f081+f082+f083+f084+f091+f092+f093+f094+f101+f102+f103+f104+f111+14
f112+f113+f114+f121+f122+f123+f124) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+15
(select sum(f011+f012+f013+f014+f021+f022+f023+f024+f031+f032+f033+f034+f041+f042+f043+f044+f051+f052+f053+f054+16
f061+f062+f063+f064+f071+f072+f073+f074+f081+f082+f083+f084+f091+f092+f093+f094+f101+f102+f103+f104+f111+f112+17
f113+f114+f121+f122+f123+f124) from lsgDwtj2006 where lsgDwtj2006.xmno=a.xmno and obs like 'EA%')18
) as ea00total,19
((select sum(f011+f021+f031+f041+f051+f061+f071+f081+f091+f101+f111+f121) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+20
(select sum(f011+f021+f031+f041+f051+f061+f071+f081+f091+f101+f111+f121) from lsgdwtj2006 where lsgDwtj2006.xmno=a.xmno)) as ea00zcgs,21
((select sum(f012+f022+f032+f042+f052+f062+f072+f082+f092+f102+f112+f122) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+22
(select sum(f012+f022+f032+f042+f052+f062+f072+f082+f092+f102+f112+f122) from lsgDwtj2006 where lsgDwtj2006.xmno=a.xmno and obs like 'EA%')) as ea00jbgs,23
((select sum(f013+f023+f033+f043+f053+f063+f073+f083+f093+f103+f113+f123) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+24
(select sum(f013+f023+f033+f043+f053+f063+f073+f083+f093+f103+f113+f123) from lsgDwtj2006 where lsgDwtj2006.xmno=a.xmno and obs like 'EA%')) as ea00wygs, 25
((select sum(f014+f024+f034+f044+f054+f064+f074+f084+f094+f104+f114+f124) from dwtj2006 where dwtj2006.xmno=a.xmno and obs like 'EA%')+26
(select sum(f014+f024+f034+f044+f054+f064+f074+f084+f094+f104+f114+f124) from lsgDwtj2006 where lsgDwtj2006.xmno=a.xmno and obs like 'EA%')) as ea00ccgs27

28
from rytj2006 a group by xmno 29

30

31

浙公网安备 33010602011771号