Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> need help in framing a query.

need help in framing a query.

From: Giridhar <gkodakalla_at_gmail.com>
Date: 11 Oct 2006 03:23:32 -0700
Message-ID: <1160562211.954245.49890@c28g2000cwb.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US