Home » Other » Training & Certification » grouping of payments based on date???
icon4.gif  grouping of payments based on date??? [message #272855] Mon, 08 October 2007 01:21 Go to next message
muraliraredew
Messages: 7
Registered: October 2007
Location: Hyderabad
Junior Member
1A table ABC that has 3 columns

Negative values are payments
Positive values are reciepts

description- amount - date
=================================
a -10000 30-08-07
b 12000 31-08-07
c 5000 31-08-07
a 15000 01-09-07
a 1200 01-09-07
b -2100 02-09-07
c -14000 03-09-07

Find receipt and payments for each day display according to date

Date Receipt Payment
===============================================================
30-08-07 (receipts for this day) (payments for this day)


[Updated on: Mon, 08 October 2007 03:29]

Report message to a moderator

Re: grouping of payments based on date [message #272858 is a reply to message #272855] Mon, 08 October 2007 01:23 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

What you have tried?
Re: grouping of payments based on date [message #272861 is a reply to message #272855] Mon, 08 October 2007 01:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
"plz pul me out of this isse" is not a description of your topic.

Please read and follow OraFAQ Forum Guide, among others section about IM speak

When you'll post what you tried, don't forget to format your code.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
Please always post your Oracle version (4 decimals).

Regards
Michel
Re: grouping of payments based on date [message #272873 is a reply to message #272858] Mon, 08 October 2007 01:53 Go to previous messageGo to next message
muraliraredew
Messages: 7
Registered: October 2007
Location: Hyderabad
Junior Member
I have problem right at the starting

i thought of using a group funtion
SUM()
and then group by date

i am beginner of SQL

i was unable to proceed further

Re: grouping of payments based on date [message #272905 is a reply to message #272873] Mon, 08 October 2007 02:41 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
First clarify the question and define what you have and what you want:
- what is "amount"?
- what should be "receipt"?
- what should be "payment"?

You thought about something, but what did you try? Why does this not work?

Regards
Michel
Re: grouping of payments based on date [message #272921 is a reply to message #272905] Mon, 08 October 2007 03:28 Go to previous messageGo to next message
muraliraredew
Messages: 7
Registered: October 2007
Location: Hyderabad
Junior Member
Negative values are payments
Positive values are reciepts

SELECT Date,SUM(amount)
FROM table
GROUP BY date

This step groups the amount(receipts+payments) according to date

what to do next?

[Updated on: Mon, 08 October 2007 03:29]

Report message to a moderator

Re: grouping of payments based on date [message #272927 is a reply to message #272921] Mon, 08 October 2007 03:46 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Use DECODE or CASE to separate payments from receipts.

Regards
Michel
Re: grouping of payments based on date [message #272932 is a reply to message #272927] Mon, 08 October 2007 04:32 Go to previous messageGo to next message
muraliraredew
Messages: 7
Registered: October 2007
Location: Hyderabad
Junior Member
thank you
Re: grouping of payments based on date [message #272936 is a reply to message #272932] Mon, 08 October 2007 04:46 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Post the solution you found when you'll find it, this will allow us to see it, maybe give you a better answer, and allow others to see how to solve this kind of issue.

Regards
Michel
Re: grouping of payments based on date [message #272943 is a reply to message #272936] Mon, 08 October 2007 05:15 Go to previous message
muraliraredew
Messages: 7
Registered: October 2007
Location: Hyderabad
Junior Member
ok i will work it out and i will post it
Previous Topic: regarding certification
Next Topic: Unix Certification
Goto Forum:
  


Current Time: Tue Nov 26 23:10:55 CST 2024