IF OBJECT_ID ('V_E0101Y', 'V') IS NOT NULL DROP VIEW V_E0101Y;
GO
CREATE VIEW V_E0101Y AS SELECT
B.EX_YYYY "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
GO
IF OBJECT_ID ('V_E0101M', 'V') IS NOT NULL DROP VIEW V_E0101M;
GO
CREATE VIEW V_E0101M AS SELECT
B.EX_YYYYMM "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
GO
IF OBJECT_ID ('V_E0101D', 'V') IS NOT NULL DROP VIEW V_E0101D;
GO
CREATE VIEW V_E0101D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
GO
IF OBJECT_ID ('V_E0101W', 'V') IS NOT NULL DROP VIEW V_E0101W;
GO
CREATE VIEW V_E0101W AS SELECT
B.EX_WEEK "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
GO
IF OBJECT_ID ('V_E0101T', 'V') IS NOT NULL DROP VIEW V_E0101T;
GO
CREATE VIEW V_E0101T AS SELECT
B.EX_TERM "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
GO
IF OBJECT_ID ('V_E0101H', 'V') IS NOT NULL DROP VIEW V_E0101H;
GO
CREATE VIEW V_E0101H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
GO
IF OBJECT_ID ('V_E0101P', 'V') IS NOT NULL DROP VIEW V_E0101P;
GO
CREATE VIEW V_E0101P AS SELECT
B.EX_TENDAYS "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
GO
IF OBJECT_ID ('V_E0102Y', 'V') IS NOT NULL DROP VIEW V_E0102Y;
GO
CREATE VIEW V_E0102Y AS SELECT
B.EX_YYYY "VPERIOD"
,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.KEY1
,A.KEY2
GO
IF OBJECT_ID ('V_E0102M', 'V') IS NOT NULL DROP VIEW V_E0102M;
GO
CREATE VIEW V_E0102M AS SELECT
B.EX_YYYYMM "VPERIOD"
,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.KEY1
,A.KEY2
GO
IF OBJECT_ID ('V_E0102D', 'V') IS NOT NULL DROP VIEW V_E0102D;
GO
CREATE VIEW V_E0102D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,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.KEY1
,A.KEY2
GO
IF OBJECT_ID ('V_E0102W', 'V') IS NOT NULL DROP VIEW V_E0102W;
GO
CREATE VIEW V_E0102W AS SELECT
B.EX_WEEK "VPERIOD"
,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.KEY1
,A.KEY2
GO
IF OBJECT_ID ('V_E0102T', 'V') IS NOT NULL DROP VIEW V_E0102T;
GO
CREATE VIEW V_E0102T AS SELECT
B.EX_TERM "VPERIOD"
,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.KEY1
,A.KEY2
GO
IF OBJECT_ID ('V_E0102H', 'V') IS NOT NULL DROP VIEW V_E0102H;
GO
CREATE VIEW V_E0102H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,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.KEY1
,A.KEY2
GO
IF OBJECT_ID ('V_E0102P', 'V') IS NOT NULL DROP VIEW V_E0102P;
GO
CREATE VIEW V_E0102P AS SELECT
B.EX_TENDAYS "VPERIOD"
,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.KEY1
,A.KEY2
GO
IF OBJECT_ID ('V_E0103Y', 'V') IS NOT NULL DROP VIEW V_E0103Y;
GO
CREATE VIEW V_E0103Y AS SELECT
B.EX_YYYY "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_E0103M', 'V') IS NOT NULL DROP VIEW V_E0103M;
GO
CREATE VIEW V_E0103M AS SELECT
B.EX_YYYYMM "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_E0103D', 'V') IS NOT NULL DROP VIEW V_E0103D;
GO
CREATE VIEW V_E0103D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_E0103W', 'V') IS NOT NULL DROP VIEW V_E0103W;
GO
CREATE VIEW V_E0103W AS SELECT
B.EX_WEEK "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_E0103T', 'V') IS NOT NULL DROP VIEW V_E0103T;
GO
CREATE VIEW V_E0103T AS SELECT
B.EX_TERM "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_E0103H', 'V') IS NOT NULL DROP VIEW V_E0103H;
GO
CREATE VIEW V_E0103H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_E0103P', 'V') IS NOT NULL DROP VIEW V_E0103P;
GO
CREATE VIEW V_E0103P AS SELECT
B.EX_TENDAYS "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
GO
IF OBJECT_ID ('V_E0104Y', 'V') IS NOT NULL DROP VIEW V_E0104Y;
GO
CREATE VIEW V_E0104Y AS SELECT
B.EX_YYYY "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0104M', 'V') IS NOT NULL DROP VIEW V_E0104M;
GO
CREATE VIEW V_E0104M AS SELECT
B.EX_YYYYMM "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0104D', 'V') IS NOT NULL DROP VIEW V_E0104D;
GO
CREATE VIEW V_E0104D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0104W', 'V') IS NOT NULL DROP VIEW V_E0104W;
GO
CREATE VIEW V_E0104W AS SELECT
B.EX_WEEK "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0104T', 'V') IS NOT NULL DROP VIEW V_E0104T;
GO
CREATE VIEW V_E0104T AS SELECT
B.EX_TERM "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0104H', 'V') IS NOT NULL DROP VIEW V_E0104H;
GO
CREATE VIEW V_E0104H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0104P', 'V') IS NOT NULL DROP VIEW V_E0104P;
GO
CREATE VIEW V_E0104P AS SELECT
B.EX_TENDAYS "VPERIOD"
,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.KEY1
,A.KEY2
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0105Y', 'V') IS NOT NULL DROP VIEW V_E0105Y;
GO
CREATE VIEW V_E0105Y AS SELECT
B.EX_YYYY "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
GO
IF OBJECT_ID ('V_E0105M', 'V') IS NOT NULL DROP VIEW V_E0105M;
GO
CREATE VIEW V_E0105M AS SELECT
B.EX_YYYYMM "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
GO
IF OBJECT_ID ('V_E0105D', 'V') IS NOT NULL DROP VIEW V_E0105D;
GO
CREATE VIEW V_E0105D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
GO
IF OBJECT_ID ('V_E0105W', 'V') IS NOT NULL DROP VIEW V_E0105W;
GO
CREATE VIEW V_E0105W AS SELECT
B.EX_WEEK "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
GO
IF OBJECT_ID ('V_E0105T', 'V') IS NOT NULL DROP VIEW V_E0105T;
GO
CREATE VIEW V_E0105T AS SELECT
B.EX_TERM "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
GO
IF OBJECT_ID ('V_E0105H', 'V') IS NOT NULL DROP VIEW V_E0105H;
GO
CREATE VIEW V_E0105H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
GO
IF OBJECT_ID ('V_E0105P', 'V') IS NOT NULL DROP VIEW V_E0105P;
GO
CREATE VIEW V_E0105P AS SELECT
B.EX_TENDAYS "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
GO
IF OBJECT_ID ('V_E0106Y', 'V') IS NOT NULL DROP VIEW V_E0106Y;
GO
CREATE VIEW V_E0106Y AS SELECT
B.EX_YYYY "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0106M', 'V') IS NOT NULL DROP VIEW V_E0106M;
GO
CREATE VIEW V_E0106M AS SELECT
B.EX_YYYYMM "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0106D', 'V') IS NOT NULL DROP VIEW V_E0106D;
GO
CREATE VIEW V_E0106D AS SELECT
B.EX_YYYYMMDD "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0106W', 'V') IS NOT NULL DROP VIEW V_E0106W;
GO
CREATE VIEW V_E0106W AS SELECT
B.EX_WEEK "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0106T', 'V') IS NOT NULL DROP VIEW V_E0106T;
GO
CREATE VIEW V_E0106T AS SELECT
B.EX_TERM "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0106H', 'V') IS NOT NULL DROP VIEW V_E0106H;
GO
CREATE VIEW V_E0106H AS SELECT
B.EX_HALFYEAR "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
,A.KEY4
GO
IF OBJECT_ID ('V_E0106P', 'V') IS NOT NULL DROP VIEW V_E0106P;
GO
CREATE VIEW V_E0106P AS SELECT
B.EX_TENDAYS "VPERIOD"
,A.KEY1 "VKEY1"
,MIN(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.KEY1
,A.KEY3
,A.KEY4
GO
