Hello,
YR PROD NO BAL TYPE BAL AMOUNT
2005 42015 1 53665201
2005 42015 19 1060606.25
2005 42015 15 8096017.47
2005 42015 23 53665201
2005 42016 1 164342737
2005 42016 15 19758687.9
2005 42016 23 164340488
2005 42016 19 3146217.26
I need to create the following resultset from the above data and I am not quite sure how to do it:
The Select should be as follow:
select YR,
PROD NO,
(Subtract BAL AMOUNT of BAL TYPE 1 from BAL AMOUNT
of BAL TYPE 23),
((Add BAL AMOUNT of BAL TYPE 15 to BAL AMOUNT of
BAL TYPE 19) Subtract (BAL AMOUNT of BAL TYPE 1))
from PRODUCT
The resultset needs to be sorted by YR and PROD NO.
The resultset needs to be group by PROD NO and YR
2005 is the only YR I will be looking at.
Could someone please help.
svc
YR PROD NO BAL TYPE BAL AMOUNT
2005 42015 1 53665201
2005 42015 19 1060606.25
2005 42015 15 8096017.47
2005 42015 23 53665201
2005 42016 1 164342737
2005 42016 15 19758687.9
2005 42016 23 164340488
2005 42016 19 3146217.26
I need to create the following resultset from the above data and I am not quite sure how to do it:
The Select should be as follow:
select YR,
PROD NO,
(Subtract BAL AMOUNT of BAL TYPE 1 from BAL AMOUNT
of BAL TYPE 23),
((Add BAL AMOUNT of BAL TYPE 15 to BAL AMOUNT of
BAL TYPE 19) Subtract (BAL AMOUNT of BAL TYPE 1))
from PRODUCT
The resultset needs to be sorted by YR and PROD NO.
The resultset needs to be group by PROD NO and YR
2005 is the only YR I will be looking at.
Could someone please help.
svc