Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL Problem (Oracle 7.3 HP-UX 10.3)
PL/SQL Problem [message #428116] Tue, 27 October 2009 05:17 Go to next message
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 #428121 is a reply to message #428116] Tue, 27 October 2009 05:35 Go to previous messageGo to next message
Michel Cadot
Messages: 63817
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Need to get desired output as mentioned in attached file.

There is no attached file.

Post a working Test case: create table and insert statements along with the result you want with these data.
And post it inline not in attached file.

Are you sure you are running an Oracle version 7.3?

Regards
Michel
Re: PL/SQL Problem [message #428144 is a reply to message #428116] Tue, 27 October 2009 06:22 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #428170 is a reply to message #428144] Tue, 27 October 2009 07:03 Go to previous messageGo to next message
Michel Cadot
Messages: 63817
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous topic:
Michel Cadot wrote on Sat, 17 January 2009 08:46
Michel Cadot wrote on Fri, 16 January 2009 07:31
What is your client tool?

Always post a Test case: create table and insert statements along with the result you want with these data.

Are you really using version 7.3?

Regards
Michel


Answer my question and post what is requested.

Re: PL/SQL Problem [message #428194 is a reply to message #428170] Tue, 27 October 2009 08:07 Go to previous messageGo to next message
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 #428202 is a reply to message #428194] Tue, 27 October 2009 08:19 Go to previous messageGo to next message
Michel Cadot
Messages: 63817
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Pls expedite for my problem.

As soon as you provide the test case.

Regards
Michel
Re: PL/SQL Problem [message #428205 is a reply to message #428202] Tue, 27 October 2009 08:32 Go to previous messageGo to next message
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 Go to previous message
Michel Cadot
Messages: 63817
Registered: March 2007
Location: Nanterre, France, http://...
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
Previous Topic: HOW TO GIVE GRANT TO A TRIGGER
Next Topic: Calling Linux Command Using Pl/SQL
Goto Forum:
  


Current Time: Fri Sep 30 17:29:24 CDT 2016

Total time taken to generate the page: 0.17404 seconds