Home » SQL & PL/SQL » SQL & PL/SQL » SQL Function query
SQL Function query [message #341610] Tue, 19 August 2008 09:18 Go to next message
wondering166
Messages: 1
Registered: August 2008
Junior Member
Hi All,

I have a table that has these type of fields

Facility (varchar), Client_Batch (Integer), Payment_Due_Date (Date), Transaction_Code(Integer), Amount (Float)

Lets assume I have various transaction_codes and I want to select a query that will show the difference between two of them

eg>

facility = abe001, client_Batch = 1, Payment_Due = today, transaction_Code = 10, amount = 50000

facility = abe001, client_Batch = 1, Payment_Due = today, transaction_Code = 20, amount = 20000

I want my result to show the one line where amount is 30000

Thanks

W

Re: SQL Function query [message #341611 is a reply to message #341610] Tue, 19 August 2008 09:20 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW the Posting Guidelines as stated in URL above
Re: SQL Function query [message #341622 is a reply to message #341610] Tue, 19 August 2008 10:16 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a look at LAG/LEAD functions.

Regards
Michel
Previous Topic: Exporting Oracle data to Excel file
Next Topic: Deleting a row but keeping the Foreign Key
Goto Forum:
  


Current Time: Sun Dec 04 14:25:20 CST 2016

Total time taken to generate the page: 0.07075 seconds