优化笔记: jxrsfxrxx_D_20140916.gz
表的重复扫描。
----------------------------------想进一步研究,继续往下看------------------------------
1. 所有相似子查询合并成一个(不仅仅是相同,如WBPJRQ,DBPJ,WBPJ字段),合并方法见下面代码。
表相连。
种算法,都要进行全部匹配。MySQL没有组合连接,只有两种算法。
对多的,用join的话,会把所有记录都比对一遍。而用exist或in,只要找到第一个就返回,不再向下扫描。
3. 第一段和第三段可以用or合并到一起。合并后代码长度减少了一半,但是性能变的更差。
因为or有时候会破坏索引(不是一定会破坏,但是我们这个案例中确实破坏了)。解决办法就是用union把or拆成几个查询。
4. 选择扫多次索引,还是一次全表扫描,具体情况具体分析。比如这个案例。
条。
万的数据。(所有的都是约数,还有扫中间节点等其他开销,但是对于这个案例,开销可以忽略)
的扫描,一次全表扫描远比扫n次索引效率高。
左右,如果忽略掉优化器自动优化,需要扫描的数据页数约7000*子查询个数*索引层级(因为每次扫描只拿一条数据,所以加上索引的层级开销会成倍数放大。)
.写sql思维要转一下,尽量批量操作。
进制位,最少也要扫8k的数据。
个数据页。而单条操作,如果走索引5*10=50个数据页(这还是在索引是聚集索引的情况下,如果是非聚集索引,再*2),不走索引10*10=100个数据页。数据量越大,这个杠杆越高。所以有时候相同的业务逻辑,不同的代码性能会差距很大。
|

|

------------------优化过脚本--------------
SELECT FXRH,
FXFL,
FXMC,
FXQC,
FXLXR,
FXRLXDH,
FXRCZ,
JBRXM,
JBRZJLX,
JBRZJHM,
JBRLXDH,
JBRCZ,
JBRQZWJM,
YLQZWJM,
FXZC,
JBYX,
WBPJ,
NBPJ,
ZHPJ,
SXED,
FXGJ,
ZCBZ,
DBPJ,
WBPJRQ
FROM (Select f34_1018 FXRH,
Case
When ob_object_name_1018 Like'%银行%'Then
'2'
Else
'1'
EndAs FXFL,
substrb(nvl(f50_1018, ob_object_name_1018), 1, 32) FXMC,
ob_object_name_1018 FXQC,
substr((Select ob_object_name_1014
From wind.tb_object_1014 a
Wheresubstr(f29_1018, 6) = a.ob_object_id),
1,
16) FXLXR,
substrb(f36_1018, 1, 32) FXRLXDH,
substrb(f37_1018, 1, 32) FXRCZ,
'' JBRXM,
'' JBRZJLX,
'' JBRZJHM,
'' JBRLXDH,
'' JBRCZ,
'' JBRQZWJM,
'' YLQZWJM,
(SelectRound(f140_1853, 2)
From wind.tb_object_1853 a
Where f1_1853 = f34_1018
And f4_1853 = '合并报表'
And f2_1853 =
(SelectMax(b.f2_1853)
From wind.tb_object_1853 b
Where b.f1_1853 = f34_1018
And b.f4_1853 = '合并报表'
Andsubstr(b.f2_1853, 5, 4) = '1231')) FXZC,
'' JBYX,
decode(pj.jno,
'AAA',
'1',
'AAA-',
'2',
'AA+',
'3',
'AA',
'4',
'AA-',
'5',
'A+',
'P',
'A',
'6',
'A-',
'7',
'BBB+',
'Q',
'BBB',
'8',
'BBB-',
'9',
'BB+',
'A',
'BB',
'B',
'BB-',
'C',
'B+',
'D',
'B',
'E',
'B-',
'F',
'CCC',
'G',
'CC',
'H',
'C',
'I',
'D',
'J',
'A-1+',
'K',
'A-1',
'L',
'A-1-',
'M',
'A-2',
'N',
'A-3',
'O',
null) WBPJ,
'' NBPJ,
'' ZHPJ,
'' SXED,
decode(f3_1018,
'中国',
'CN',
'英国',
'GB',
'美国',
'US',
'澳大利亚',
'AU',
'百慕大群岛',
'BM',
'加拿大',
'CA',
'德国',
'DE',
'中国台湾',
'TW',
'新加坡',
'SG',
'俄罗斯',
'RU',
'韩国',
'KR',
'日本',
'JP',
'以色列',
'IL',
'爱尔兰',
'IE',
'中国香港',
'HK',
null) FXGJ,
'CNY' ZCBZ,
decode(pj.jno,
'AAA',
'1',
'AAA-',
'2',
'AA+',
'3',
'AA',
'4',
'AA-',
'5',
'A',
'6',
'BBB',
'7',
'BB',
'8',
'B',
'9',
null) DBPJ,
pj.rq WBPJRQ
From wind.tb_object_1018
leftjoin (Select a.f2_1734, Max(f4_1734) jno, max(f5_1734) rq
From wind.tb_object_1734 a
Where f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f2_1734 = a.f2_1734)
groupby a.f2_1734) pj
on f34_1018 = pj.f2_1734
whereexists
(select1
from wind.tb_object_1090
where f34_1018 = ob_revisions_1090
and f4_1090 In
('A', 'B', 'Z', 'Q', 'K', 'DQ', 'P', 'F', 'ZC'))
union
Select f34_1018,
case
when f41_1018 = 18THEN
'3'
ELSE
'1'
END,
case
when f41_1018 = 18THEN
substr(ob_object_name_1018,
1,
instr(ob_object_name_1018, '基金') + 1)
ELSE
ob_object_name_1018
END,
ob_object_name_1018,
substr((Select ob_object_name_1014
From wind.tb_object_1014 a
Wheresubstr(f29_1018, 6) = a.ob_object_id),
1,
16),
substrb(f36_1018, 1, 32),
substrb(f37_1018, 1, 32),
'',
'',
'',
'',
'',
'',
'',
to_number(''),
'' JBYX,
decode(pj.jno,
'AAA',
'1',
'AAA-',
'2',
'AA+',
'3',
'AA',
'4',
'AA-',
'5',
'A+',
'P',
'A',
'6',
'A-',
'7',
'BBB+',
'Q',
'BBB',
'8',
'BBB-',
'9',
'BB+',
'A',
'BB',
'B',
'BB-',
'C',
'B+',
'D',
'B',
'E',
'B-',
'F',
'CCC',
'G',
'CC',
'H',
'C',
'I',
'D',
'J',
'A-1+',
'K',
'A-1',
'L',
'A-1-',
'M',
'A-2',
'N',
'A-3',
'O',
null) WBPJ,
'' NBPJ,
'' ZHPJ,
'' SXED,
decode(f3_1018,
'中国',
'CN',
'英国',
'GB',
'美国',
'US',
'澳大利亚',
'AU',
'百慕大群岛',
'BM',
'加拿大',
'CA',
'德国',
'DE',
'中国台湾',
'TW',
'新加坡',
'SG',
'俄罗斯',
'RU',
'韩国',
'KR',
'日本',
'JP',
'以色列',
'IL',
'爱尔兰',
'IE',
'中国香港',
'HK',
null) FXGJ,
'CNY' ZCBZ,
decode(pj.jno,
'AAA',
'1',
'AAA-',
'2',
'AA+',
'3',
'AA',
'4',
'AA-',
'5',
'A',
'6',
'BBB',
'7',
'BB',
'8',
'B',
'9',
null) DBPJ,
pj.rq WBPJRQ
From wind.tb_object_1018
leftjoin (Select a.f2_1734, Max(f4_1734) jno, max(f5_1734) rq
From wind.tb_object_1734 a
Where f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f2_1734 = a.f2_1734)
groupby a.f2_1734) pj
on f34_1018 = pj.f2_1734
Where f34_1018 In (Select f12_1099 From wind.tb_object_1099)
union
Select f34_1018 FXRH,
Case
When ob_object_name_1018 Like'%银行%'Then
'2'
Else
'1'
EndAs FXFL,
substrb(nvl(f50_1018, ob_object_name_1018), 1, 32) FXMC,
ob_object_name_1018 FXQC,
substr((Select ob_object_name_1014
From wind.tb_object_1014 a
Wheresubstr(f29_1018, 6) = a.ob_object_id),
1,
16) FXLXR,
substrb(f36_1018, 1, 32) FXRLXDH,
substrb(f37_1018, 1, 32) FXRCZ,
'' JBRXM,
'' JBRZJLX,
'' JBRZJHM,
'' JBRLXDH,
'' JBRCZ,
'' JBRQZWJM,
'' YLQZWJM,
(SelectRound(f140_1853, 2)
From wind.tb_object_1853 a
Where f1_1853 = f34_1018
And f4_1853 = '合并报表'
And f2_1853 =
(SelectMax(b.f2_1853)
From wind.tb_object_1853 b
Where b.f1_1853 = f34_1018
And b.f4_1853 = '合并报表'
Andsubstr(b.f2_1853, 5, 4) = '1231')) FXZC,
'' JBYX,
decode(pj.jno,
'AAA',
'1',
'AAA-',
'2',
'AA+',
'3',
'AA',
'4',
'AA-',
'5',
'A+',
'P',
'A',
'6',
'A-',
'7',
'BBB+',
'Q',
'BBB',
'8',
'BBB-',
'9',
'BB+',
'A',
'BB',
'B',
'BB-',
'C',
'B+',
'D',
'B',
'E',
'B-',
'F',
'CCC',
'G',
'CC',
'H',
'C',
'I',
'D',
'J',
'A-1+',
'K',
'A-1',
'L',
'A-1-',
'M',
'A-2',
'N',
'A-3',
'O',
null) WBPJ,
'' NBPJ,
'' ZHPJ,
'' SXED,
decode(f3_1018,
'中国',
'CN',
'英国',
'GB',
'美国',
'US',
'澳大利亚',
'AU',
'百慕大群岛',
'BM',
'加拿大',
'CA',
'德国',
'DE',
'中国台湾',
'TW',
'新加坡',
'SG',
'俄罗斯',
'RU',
'韩国',
'KR',
'日本',
'JP',
'以色列',
'IL',
'爱尔兰',
'IE',
'中国香港',
'HK',
null) FXGJ,
'CNY' ZCBZ,
decode(pj.jno,
'AAA',
'1',
'AAA-',
'2',
'AA+',
'3',
'AA',
'4',
'AA-',
'5',
'A',
'6',
'BBB',
'7',
'BB',
'8',
'B',
'9',
null) DBPJ,
pj.rq WBPJRQ
From wind.tb_object_1018
leftjoin (Select a.f2_1734, Max(f4_1734) jno, max(f5_1734) rq
From wind.tb_object_1734 a
Where f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f2_1734 = a.f2_1734)
groupby a.f2_1734) pj
on f34_1018 = pj.f2_1734
whereExists
(Select1From wind.tb_object_1429 Where f47_1429 = f34_1018))
OrderBy2, 3
----------------原脚本------------------------
SELECT FXRH,
FXFL,
FXMC,
FXQC,
FXLXR,
FXRLXDH,
FXRCZ,
JBRXM,
JBRZJLX,
JBRZJHM,
JBRLXDH,
JBRCZ,
JBRQZWJM,
YLQZWJM,
FXZC,
JBYX,
WBPJ,
NBPJ,
ZHPJ,
SXED,
FXGJ,
ZCBZ,
DBPJ,
WBPJRQ
FROM (SelectDistinct f34_1018 FXRH, --distinct去掉,union已经去重。distinct暗含排序操作,会占用系统临时表。
Case
When ob_object_name_1018 Like'%银行%'Then
'2'
Else
'1'
EndAs FXFL,
substrb(nvl(f50_1018, ob_object_name_1018), 1, 32) FXMC,
ob_object_name_1018 FXQC,
substr((Select ob_object_name_1014
From wind.tb_object_1014 a
Wheresubstr(f29_1018, 6) = a.ob_object_id),
1,
16) FXLXR,
substrb(f36_1018, 1, 32) FXRLXDH,
substrb(f37_1018, 1, 32) FXRCZ,
'' JBRXM,
'' JBRZJLX,
'' JBRZJHM,
'' JBRLXDH,
'' JBRCZ,
'' JBRQZWJM,
'' YLQZWJM,
(SelectRound(f140_1853, 2)
From wind.tb_object_1853 a
Where f1_1853 = f34_1018
And f4_1853 = '合并报表'
And f2_1853 =
(SelectMax(b.f2_1853)
From wind.tb_object_1853 b
Where b.f1_1853 = a.f1_1853
And b.f4_1853 = '合并报表'
Andsubstr(b.f2_1853, 5, 4) = '1231')) FXZC,
'' JBYX,
Case
When (SelectMax(f4_1734) --以下所有对1734的扫描合并成一次
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'AAA'Then
'1'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'AAA-'Then
'2'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'AA+'Then
'3'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA'Then
'4'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'AA-'Then
'5'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A+'Then
'P'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A'Then
'6'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-'Then
'7'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'BBB+'Then
'Q'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'BBB'Then
'8'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'BBB-'Then
'9'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'BB+'Then
'A'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB'Then
'B'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'BB-'Then
'C'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B+'Then
'D'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B'Then
'E'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B-'Then
'F'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'CCC'Then
'G'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'CC'Then
'H'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'C'Then
'I'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'D'Then
'J'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'A-1+'Then
'K'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'A-1'Then
'L'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'A-1-'Then
'M'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'A-2'Then
'N'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'A-3'Then
'O'
End WBPJ,
'' NBPJ,
'' ZHPJ,
'' SXED,
case
when f3_1018 = '中国'then
'CN'
when f3_1018 = '英国'then
'GB'
when f3_1018 = '美国'then
'US'
when f3_1018 = '澳大利亚'then
'AU'
when f3_1018 = '百慕大群岛'then
'BM'
when f3_1018 = '加拿大'then
'CA'
when f3_1018 = '德国'then
'DE'
when f3_1018 = '中国台湾'then
'TW'
when f3_1018 = '新加坡'then
'SG'
when f3_1018 = '俄罗斯'then
'RU'
when f3_1018 = '韩国'then
'KR'
when f3_1018 = '日本'then
'JP'
when f3_1018 = '以色列'then
'IL'
when f3_1018 = '爱尔兰'then
'IE'
when f3_1018 = '中国香港'then
'HK'
end FXGJ,
'CNY' ZCBZ,
Case
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'AAA'Then
'1'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'AAA-'Then
'2'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'AA+'Then
'3'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA'Then
'4'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'AA-'Then
'5'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A'Then
'6'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) =
'BBB'Then
'7'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB'Then
'8'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B'Then
'9'
End DBPJ,
(SelectMax(f5_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) WBPJRQ
From wind.tb_object_1090, wind.tb_object_1018
Where f4_1090 In ('A', 'B', 'Z', 'Q', 'K', 'DQ', 'P', 'F', 'ZC')
And f34_1018 = ob_revisions_1090
Union
Select f34_1018,
case
when f41_1018 = 18THEN
'3'
ELSE
'1'
END,
case
when f41_1018 = 18THEN
substr(ob_object_name_1018,
1,
instr(ob_object_name_1018, '基金') + 1)
ELSE
ob_object_name_1018
END,
ob_object_name_1018,
substr((Select ob_object_name_1014
From wind.tb_object_1014 a
Wheresubstr(f29_1018, 6) = a.ob_object_id),
1,
16),
substrb(f36_1018, 1, 32),
substrb(f37_1018, 1, 32),
'',
'',
'',
'',
'',
'',
'',
to_number(''),
'' JBYX,
Case
When (SelectMax(f4_1734) --同上
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AAA'Then
'1'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AAA-'Then
'2'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA+'Then
'3'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA'Then
'4'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA-'Then
'5'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A+'Then
'P'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A'Then
'6'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-'Then
'7'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BBB+'Then
'Q'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BBB'Then
'8'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BBB-'Then
'9'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB+'Then
'A'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB'Then
'B'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB-'Then
'C'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B+'Then
'D'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B'Then
'E'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B-'Then
'F'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'CCC'Then
'G'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'CC'Then
'H'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'C'Then
'I'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'D'Then
'J'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-1+'Then
'K'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-1'Then
'L'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-1-'Then
'M'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-2'Then
'N'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-3'Then
'O'
End WBPJ,
'' NBPJ,
'' ZHPJ,
'' SXED,
case
when f3_1018 = '中国'then
'CN'
when f3_1018 = '英国'then
'GB'
when f3_1018 = '美国'then
'US'
when f3_1018 = '澳大利亚'then
'AU'
when f3_1018 = '百慕大群岛'then
'BM'
when f3_1018 = '加拿大'then
'CA'
when f3_1018 = '德国'then
'DE'
when f3_1018 = '中国台湾'then
'TW'
when f3_1018 = '新加坡'then
'SG'
when f3_1018 = '俄罗斯'then
'RU'
when f3_1018 = '韩国'then
'KR'
when f3_1018 = '日本'then
'JP'
when f3_1018 = '以色列'then
'IL'
when f3_1018 = '爱尔兰'then
'IE'
when f3_1018 = '中国香港'then
'HK'
end FXGJ,
'CNY' ZCBZ,
Case
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AAA'Then
'1'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AAA-'Then
'2'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA+'Then
'3'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA'Then
'4'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA-'Then
'5'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A'Then
'6'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BBB'Then
'7'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB'Then
'8'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B'Then
'9'
End DBPJ,
(SelectMax(f5_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 = (SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) WBPJRQ
From wind.tb_object_1018
Where f34_1018 In (Select f12_1099 From wind.tb_object_1099)
UNION
Select f34_1018,
Case
When ob_object_name_1018 Like'%银行%'Then
'2'
Else
'1'
End,
substrb(nvl(f50_1018, ob_object_name_1018), 1, 32),
ob_object_name_1018,
substr((Select ob_object_name_1014
From wind.tb_object_1014 a
Wheresubstr(f29_1018, 6) = a.ob_object_id),
1,
16),
substrb(f36_1018, 1, 32),
substrb(f37_1018, 1, 32),
'',
'',
'',
'',
'',
'',
'',
(SelectRound(f140_1853, 2)
From wind.tb_object_1853 a
Where f1_1853 = f34_1018
And f4_1853 = '合并报表'
And f2_1853 =
(SelectMax(b.f2_1853)
From wind.tb_object_1853 b
Where b.f1_1853 = a.f1_1853
And b.f4_1853 = '合并报表'
Andsubstr(b.f2_1853, 5, 4) = '1231')) FXZC,
'' JBYX,
Case
When (SelectMax(f4_1734) ----同上
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AAA'Then
'1'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AAA-'Then
'2'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA+'Then
'3'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA'Then
'4'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA-'Then
'5'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A+'Then
'P'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A'Then
'6'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-'Then
'7'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BBB+'Then
'Q'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BBB'Then
'8'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BBB-'Then
'9'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB+'Then
'A'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB'Then
'B'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB-'Then
'C'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B+'Then
'D'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B'Then
'E'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B-'Then
'F'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'CCC'Then
'G'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'CC'Then
'H'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'C'Then
'I'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'D'Then
'J'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-1+'Then
'K'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-1'Then
'L'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-1-'Then
'M'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-2'Then
'N'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A-3'Then
'O'
End WBPJ,
'' NBPJ,
'' ZHPJ,
'' SXED,
case
when f3_1018 = '中国'then
'CN'
when f3_1018 = '英国'then
'GB'
when f3_1018 = '美国'then
'US'
when f3_1018 = '澳大利亚'then
'AU'
when f3_1018 = '百慕大群岛'then
'BM'
when f3_1018 = '加拿大'then
'CA'
when f3_1018 = '德国'then
'DE'
when f3_1018 = '中国台湾'then
'TW'
when f3_1018 = '新加坡'then
'SG'
when f3_1018 = '俄罗斯'then
'RU'
when f3_1018 = '韩国'then
'KR'
when f3_1018 = '日本'then
'JP'
when f3_1018 = '以色列'then
'IL'
when f3_1018 = '爱尔兰'then
'IE'
when f3_1018 = '中国香港'then
'HK'
end FXGJ,
'CNY' ZCBZ,
Case
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AAA'Then
'1'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AAA-'Then
'2'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA+'Then
'3'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA'Then
'4'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'AA-'Then
'5'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'A'Then
'6'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BBB'Then
'7'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'BB'Then
'8'
When (SelectMax(f4_1734)
From wind.tb_object_1734 a,
wind.tb_object_0004,
wind.tb_object_1429
Where f47_1429 = f34_1018
And ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 =
(SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) = 'B'Then
'9'
End DBPJ,
(SelectMax(f5_1734)
From wind.tb_object_1734 a, wind.tb_object_0004
Where ob_object_name_1018 = f1_0004
And f3_0004 = f2_1734
And f5_1734 = (SelectMax(f5_1734)
From wind.tb_object_1734 b
Where b.f1_1734 = a.f1_1734)) WBPJRQ
From wind.tb_object_1018 T
WhereExists
(Select1From wind.tb_object_1429 Where f47_1429 = f34_1018))
OrderBy2, 3
优化笔记: jxrsfxrxx_D_20140916.gz的更多相关文章
- 优化笔记:pfyhparopenfundinfotest_D_20140916.gz
性能瓶颈在函数的乱用.原代码黄色部分. 12分钟->35秒 ------------------------------------------------------------------- ...
- Android App性能优化笔记之一:性能优化是什么及为什么?
By Long Luo 周星驰的电影<功夫>里面借火云邪神之口说出了一句至理名言:“天下武功,唯快不破”. 在移动互联网时代,同样如此,留给一个公司的窗口往往只有很短的时间,如何把握住 ...
- (转)MySQL优化笔记(八)--锁机制超详细解析(锁分类、事务并发、引擎并发控制)
当一个系统访问量上来的时候,不只是数据库性能瓶颈问题了,数据库数据安全也会浮现,这时候合理使用数据库锁机制就显得异常重要了. 原文:http://www.jianshu.com/p/163c96983 ...
- U3D开发性能优化笔记(待增加版本.x)
http://blog.csdn.net/kaitiren/article/details/45071997 此总结由自己经验及网上收集整理优化内容 包括: .代码方面: .函数使用方面: .ui注意 ...
- CMU Convex Optimization(凸优化)笔记1--凸集和凸函数
CMU凸优化笔记--凸集和凸函数 结束了一段时间的学习任务,于是打算做个总结.主要内容都是基于CMU的Ryan Tibshirani开设的Convex Optimization课程做的笔记.这里只摘了 ...
- 优化笔记:jsyhjkzqxx_D_20140916.gz
有几张表没有权限,所以跑不起来. 目测黄色部分比较坑爹,死了n多脑细胞才看懂,又死了n多脑细胞才改出来.对5034进行了2次扫描,并多次分组排序求和.(分组和排序算法相对来说比较耗性能) 改为只扫描一 ...
- 移动web性能优化笔记
移动web性能优化 最近看了一些文章,对移动web性能优化方法,做一个简单笔记 笔记内容主要出自 移动H5前端性能优化指南和移动前端系列——移动页面性能优化
- mysql系列十一、mysql优化笔记:表设计、sql优化、配置优化
可以从这些方面进行优化: 数据库(表)设计合理 SQL语句优化 数据库配置优化 系统层.硬件层优化 数据库设计 关系数据库三范式 1NF:字段不可分; 2NF:有主键,非主键字段依赖主键; 3NF:非 ...
- nginx优化笔记(keepalive、https等)
一.nginx之tcp_nopush.tcp_nodelay.sendfile 1.TCP_NODELAY你怎么可以强制 socket 在它的缓冲区里发送数据?一个解决方案是 TCP 堆栈的 TCP_ ...
随机推荐
- Js/Jquery获取网页屏幕可见区域高度
获取浏览器窗口的可视区域高度和宽度,滚动条高度有需要的朋友可参考一下. 1 document.body.clientWidth ==> BODY对象宽度 2 document.body.clie ...
- SSH项目搭建(二)
本章讲解SSH项目需要到哪些jar包,及各个jar包的作用 一.struts2 1.下载好struts2,struts2文件夹>>>>apps>>>>a ...
- Sublime Text 2 设置文件详解(转)
Sublime Text 2是那种让人会一眼就爱上的编辑器,不仅GUI让人眼前一亮,功能更是没的说,拓展性目前来说也完全够用了,网上介绍软件的文章和推荐插件的文章也不少,而且很不错,大家可以去找找自己 ...
- sockaddr和sockaddr_in的区别
struct sockaddr和struct sockaddr_in这两个结构体用来处理网络通信的地址. 在各种系统调用或者函数中,只要和网络地址打交道,就得用到这两个结构体. 网络中的地址包含3个方 ...
- BZOJ4999:This Problem Is Too Simple!(DFS序&树上差分&线段树动态开点:区间修改单点查询)
Description 给您一颗树,每个节点有个初始值. 现在支持以下两种操作: 1. C i x(0<=x<2^31) 表示将i节点的值改为x. 2. Q i j x(0<=x&l ...
- JSON和JSONP简单总结
jsonp和json的区别,原理,在jquery中的使用 http://www.cnblogs.com/dowinning/archive/2012/04/19/json-jsonp-jquery.h ...
- 将 UWP 的有效像素(Effective Pixels)引入 WPF
在很久很久以前,WPF 诞生之初,有一个神奇的单位,它的名字叫做——设备无关单位(DIP,Device Independent Unit).微软给它描绘了一片美好的愿景——在任何显示器上显示的尺寸是相 ...
- Buy Tickets(线段树单点更新,逆向思维)
题目大意:有n个的排队,每一个人都有一个val来对应,每一个后来人都会插入当前队伍的某一个位置pos.要求把队伍最后的状态输出. 个人心得:哈哈,用链表写了下,果不其然超时了,后面转念一想要用静态数组 ...
- WebApi系列~通过HttpClient来调用Web Api接口~续~实体参数的传递 【转】
原文:http://www.cnblogs.com/lori/p/4045633.html 下面定义一个复杂类型对象 public class User_Info { public int Id { ...
- iptables规则绑定在port而不是拦截在协议栈
版权声明:本文为博主原创,无版权.未经博主同意能够任意转载,无需注明出处,任意改动或保持可作为原创! https://blog.csdn.net/dog250/article/details/2417 ...