IF OBJECT_ID ('V_A0301Y', 'V') IS NOT NULL DROP VIEW V_A0301Y;
GO
CREATE VIEW V_A0301Y AS SELECT
B.EX_YYYY "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,MIN(A.KEY3) "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DAY B, EX_DATA2 A
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYY
,A.KEY2
GO
IF OBJECT_ID ('V_A0301M', 'V') IS NOT NULL DROP VIEW V_A0301M;
GO
CREATE VIEW V_A0301M AS SELECT
B.EX_YYYYMM "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,MIN(A.KEY3) "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYYMM
,A.KEY2
GO
IF OBJECT_ID ('V_A0301D', 'V') IS NOT NULL DROP VIEW V_A0301D;
GO
CREATE VIEW V_A0301D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,MIN(A.KEY3) "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYYMMDD
,A.KEY2
GO
IF OBJECT_ID ('V_A0301W', 'V') IS NOT NULL DROP VIEW V_A0301W;
GO
CREATE VIEW V_A0301W AS SELECT
B.EX_WEEK "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,MIN(A.KEY3) "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_WEEK
,A.KEY2
GO
IF OBJECT_ID ('V_A0301T', 'V') IS NOT NULL DROP VIEW V_A0301T;
GO
CREATE VIEW V_A0301T AS SELECT
B.EX_TERM "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,MIN(A.KEY3) "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DAY B, EX_DATA2 A
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_TERM
,A.KEY2
GO
IF OBJECT_ID ('V_A0301H', 'V') IS NOT NULL DROP VIEW V_A0301H;
GO
CREATE VIEW V_A0301H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,MIN(A.KEY3) "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_HALFYEAR
,A.KEY2
GO
IF OBJECT_ID ('V_A0301P', 'V') IS NOT NULL DROP VIEW V_A0301P;
GO
CREATE VIEW V_A0301P AS SELECT
B.EX_TENDAYS "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,MIN(A.KEY3) "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_TENDAYS
,A.KEY2
GO
IF OBJECT_ID ('V_A0302Y', 'V') IS NOT NULL DROP VIEW V_A0302Y;
GO
CREATE VIEW V_A0302Y AS SELECT
B.EX_YYYY "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DAY B, EX_DATA2 A
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYY
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_A0302M', 'V') IS NOT NULL DROP VIEW V_A0302M;
GO
CREATE VIEW V_A0302M AS SELECT
B.EX_YYYYMM "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYYMM
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_A0302D', 'V') IS NOT NULL DROP VIEW V_A0302D;
GO
CREATE VIEW V_A0302D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYYMMDD
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_A0302W', 'V') IS NOT NULL DROP VIEW V_A0302W;
GO
CREATE VIEW V_A0302W AS SELECT
B.EX_WEEK "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_WEEK
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_A0302T', 'V') IS NOT NULL DROP VIEW V_A0302T;
GO
CREATE VIEW V_A0302T AS SELECT
B.EX_TERM "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DAY B, EX_DATA2 A
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_TERM
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_A0302H', 'V') IS NOT NULL DROP VIEW V_A0302H;
GO
CREATE VIEW V_A0302H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_HALFYEAR
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_A0302P', 'V') IS NOT NULL DROP VIEW V_A0302P;
GO
CREATE VIEW V_A0302P AS SELECT
B.EX_TENDAYS "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,MIN(A.KEY4) "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_TENDAYS
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_A0303Y', 'V') IS NOT NULL DROP VIEW V_A0303Y;
GO
CREATE VIEW V_A0303Y AS SELECT
B.EX_YYYY "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,A.KEY4 "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DAY B, EX_DATA2 A
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYY
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_A0303M', 'V') IS NOT NULL DROP VIEW V_A0303M;
GO
CREATE VIEW V_A0303M AS SELECT
B.EX_YYYYMM "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,A.KEY4 "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYYMM
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_A0303D', 'V') IS NOT NULL DROP VIEW V_A0303D;
GO
CREATE VIEW V_A0303D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,A.KEY4 "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_YYYYMMDD
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_A0303W', 'V') IS NOT NULL DROP VIEW V_A0303W;
GO
CREATE VIEW V_A0303W AS SELECT
B.EX_WEEK "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,A.KEY4 "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_WEEK
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_A0303T', 'V') IS NOT NULL DROP VIEW V_A0303T;
GO
CREATE VIEW V_A0303T AS SELECT
B.EX_TERM "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,A.KEY4 "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DAY B, EX_DATA2 A
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_TERM
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_A0303H', 'V') IS NOT NULL DROP VIEW V_A0303H;
GO
CREATE VIEW V_A0303H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,A.KEY4 "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_HALFYEAR
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_A0303P', 'V') IS NOT NULL DROP VIEW V_A0303P;
GO
CREATE VIEW V_A0303P AS SELECT
B.EX_TENDAYS "VPERIOD"
,MIN(A.KEY1) "VKEY1"
,A.KEY2 "VKEY2"
,A.KEY3 "VKEY3"
,A.KEY4 "VKEY4"
,MIN(A.KEY5) "VKEY5"
,MIN(A.KEY6) "VKEY6"
,MIN(A.KEY7) "VKEY7"
,MIN(A.KEY8) "VKEY8"
,MIN(A.KEY9) "VKEY9"
,MIN(A.KEY10) "VKEY10"
,MIN(A.KEY11) "VKEY11"
,MIN(A.KEY12) "VKEY12"
,MIN(A.KEY13) "VKEY13"
,MIN(A.KEY14) "VKEY14"
,MIN(A.KEY15) "VKEY15"
,MIN(A.KEY16) "VKEY16"
,MIN(A.KEY17) "VKEY17"
,MIN(A.KEY18) "VKEY18"
,MIN(A.KEY19) "VKEY19"
,MIN(A.KEY20) "VKEY20"
,MIN(A.KEY21) "VKEY21"
,MIN(A.KEY22) "VKEY22"
,MIN(A.KEY23) "VKEY23"
,MIN(A.KEY24) "VKEY24"
,MIN(A.KEY25) "VKEY25"
,MIN(A.KEY26) "VKEY26"
,MIN(A.KEY27) "VKEY27"
,MIN(A.KEY28) "VKEY28"
,MIN(A.KEY29) "VKEY29"
,MIN(A.KEY30) "VKEY30"
,SUM(A.D1) "VD1"
,SUM(A.D2) "VD2"
,SUM(A.D3) "VD3"
,SUM(A.D4) "VD4"
,SUM(A.D5) "VD5"
,SUM(A.D6) "VD6"
,SUM(A.D7) "VD7"
,SUM(A.D8) "VD8"
,SUM(A.D9) "VD9"
,SUM(A.D10) "VD10"
,SUM(A.D11) "VD11"
,SUM(A.D12) "VD12"
,SUM(A.D13) "VD13"
,SUM(A.D14) "VD14"
,SUM(A.D15) "VD15"
,SUM(A.D16) "VD16"
,SUM(A.D17) "VD17"
,SUM(A.D18) "VD18"
,SUM(A.D19) "VD19"
,SUM(A.D20) "VD20"
,SUM(A.D21) "VD21"
,SUM(A.D22) "VD22"
,SUM(A.D23) "VD23"
,SUM(A.D24) "VD24"
,SUM(A.D25) "VD25"
,SUM(A.D26) "VD26"
,SUM(A.D27) "VD27"
,SUM(A.D28) "VD28"
,SUM(A.D29) "VD29"
,SUM(A.D30) "VD30"
FROM EX_DATA2 A, EX_DAY B
WHERE A.DATE1 = B.EX_DATE
GROUP BY B.EX_TENDAYS
,A.KEY2
,A.KEY3
,A.KEY4
GO
