PL/SQL Problem [message #428116] |
Tue, 27 October 2009 05:17  |
sunidhi
Messages: 36 Registered: January 2006 Location: New Delhi
|
Member |
|
|
Hi all,
Need to get desired output as mentioned in attached file.
Let me explain :-
I got table A in which material from different vendors with sub-code is coming but I want to post their total amount to their sub code category in which they are coming like given in attached file.
Pls help me to resolve this issue t earliest.
Rgds,
Sunidhi
|
|
|
|
Re: PL/SQL Problem [message #428144 is a reply to message #428116] |
Tue, 27 October 2009 06:22   |
sunidhi
Messages: 36 Registered: January 2006 Location: New Delhi
|
Member |
|
|
Like table as showed
Table: - A (I got this)
CCode Sub-Code Type Vrno Sr Debit Amount
1810 2701 Purchase 1 1 1 100
1810 2703 Purchase 1 2 1 300
1810 2704 Purchase 1 3 1 500
1810 2707 Purchase 1 4 1 200
-----------------------------------------------------------
1810 2702 Purchase 1 5 1 400
1810 2706 Purchase 1 6 1 200
1810 2709 Purchase 1 7 1 300
1810 2708 Purchase 1 8 1 900
Ccode same 1810
Sub-Code (2701, 2703, 2704, and 2707) comes under 2501 sub code whose total is 1100
Sub-code (2702, 2706, 2709, and 2708) comes under 2502 sub code whose total is 1800
Table: - A Desired Output
Total amount of sub-codes to be posted under their sub-code category
CCode Sub-Code Type Vrno Credit Amount
1810 2501 Bank 1 2 1100
1810 2502 Bank 1 2 1800
.
.
.
.
rgds,
Sunidhi
[EDITED by LF: applied [pre] tags]
[Updated on: Tue, 27 October 2009 08:11] by Moderator Report message to a moderator
|
|
|
Re: PL/SQL Problem [message #428163 is a reply to message #428144] |
Tue, 27 October 2009 06:50   |
ayush_anand
Messages: 417 Registered: November 2008
|
Senior Member |
|
|
group by decode(sub-code,2701,1, 2703,1, 2704,1, 2707,2702,2,2706,2,2709,2,2708,2)
or else
select a,b,sum(d) over (partition by decode(b,1,1,2,1,3,1,4,2,5,2))
from logic
[Updated on: Tue, 27 October 2009 06:52] Report message to a moderator
|
|
|
|
Re: PL/SQL Problem [message #428194 is a reply to message #428170] |
Tue, 27 October 2009 08:07   |
sunidhi
Messages: 36 Registered: January 2006 Location: New Delhi
|
Member |
|
|
Dear Michael, We are still using Oracle 7.3,Forms3.0 Menu5.5 on HP UX 10.3.
Pls expedite for my problem. I need to get it solved at earliest.(PL/SQL)
rgds,
Nitin
|
|
|
|
Re: PL/SQL Problem [message #428205 is a reply to message #428202] |
Tue, 27 October 2009 08:32   |
sunidhi
Messages: 36 Registered: January 2006 Location: New Delhi
|
Member |
|
|
Sorry Michael.
Test Case ??
Didn't get it what are you trying to say ?
Pls explain it in detail as I am newbie to this site.
rgds,
Sunidhi
|
|
|
Re: PL/SQL Problem [message #428209 is a reply to message #428205] |
Tue, 27 October 2009 08:47  |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Did you read the link I posted, just click on "Test case" in my previous posts. Don't you know what are "create table and insert statements"?
Regards
Michel
|
|
|