Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> need help in framing a query.
CREATE TABLE KGR (CSP_NUM CHAR(9), PYBL_MTH NUMBER,CF_AMOUNT NUMBER);
INSERT INTO KGR VALUES ('459200101',1,100); INSERT INTO KGR VALUES ('459200101',2,200); INSERT INTO KGR VALUES ('459200101',9,900);COMMIT; PYBL_MTH has details of month. assume i work only for this year. so i might be having only 12 records for a CSP_NUM maximum. CF_AMOUNT is Cash Flow amount for that month for that csp_num.
my requirement is like this. I need to get data in this format. we need to prepare a string for 12 months of a year. If there is value for that month, we would put that value in that position.If there is no value, put "-" in that position.
CSP_NUM PYBL_VALUE
459200101 100|200|-|-|-|-|-|-|900|-|-|-|
Can you please help me in framing this query.
Thanks,
Giridhar Kodakalla
Received on Wed Oct 11 2006 - 05:23:32 CDT