Home » SQL & PL/SQL » SQL & PL/SQL » Help me out with this query too (oracle SQL 10g)
Help me out with this query too [message #432086] Sat, 21 November 2009 00:36 Go to next message
Messages: 2
Registered: November 2009
Location: Bangalore
Junior Member
I got transaction table
Individual_id    Trans_date    Trans_amt    deb_cred_indicator
   001            01-JAN-09      1600           CR
   002            05-JAN-09       700           CR
   001            25-JAN-09       800           CR  
   001            10-JAN-09       300           DR
   002            25-JAN-09       400           DR
   001            10-FEB-09       300           CR
   001            15-FEB-09       500           DR
   002            20-FEB-09       800           DR
   002            25-FEB-09       500           CR
   002            28-FEB-09       200           CR

(1)The output should be

Individual_id    Month   Closing_balance  No_of_transaction
   001            JAN      2100               3
   002            JAN       300               2
   001            FEB      -200               2
   002            FEB      -100               3

Help me..

[Mod-edit: Frank added code tags to improve readability]

[Updated on: Sun, 22 November 2009 04:32] by Moderator

Report message to a moderator

Re: Help me out with this query too [message #432091 is a reply to message #432086] Sat, 21 November 2009 00:57 Go to previous messageGo to next message
Michel Cadot
Messages: 65090
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

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

Explain your requirements WITH WORDS.

Re: Help me out with this query too [message #432092 is a reply to message #432086] Sat, 21 November 2009 01:48 Go to previous message
Messages: 2456
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member

And show us what you tried and got


[Updated on: Sat, 21 November 2009 01:49]

Report message to a moderator

Previous Topic: i got a query to solve
Next Topic: Why order by clause is not working in subquery
Goto Forum:

Current Time: Thu Jul 27 12:05:05 CDT 2017

Total time taken to generate the page: 0.10787 seconds