Home » SQL & PL/SQL » SQL & PL/SQL » pl/sql (oracle9i, Windows XP..SP2)
pl/sql [message #413425] Wed, 15 July 2009 11:38 Go to next message
gaytri_25
Messages: 6
Registered: July 2009
Location: mumbai
Junior Member

Hi,
I have made a pivot table that compares the quantity sold between 2 months.
I would now like to show the difference between the Q1M1 & Q2M2.
for example

Q1 M1 = 2500
Q2 M2 = 2000
difference = 500

what is the function i need to use.... so it will give me the difference for each row.... the rows represented are for each category.

thanks
Re: pl/sql [message #413427 is a reply to message #413425] Wed, 15 July 2009 11:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
minus (-): Q1M1-Q2M2

Regards
Michel
Re: pl/sql [message #413430 is a reply to message #413427] Wed, 15 July 2009 11:54 Go to previous messageGo to next message
gaytri_25
Messages: 6
Registered: July 2009
Location: mumbai
Junior Member

Thank you
Re: pl/sql [message #413513 is a reply to message #413425] Thu, 16 July 2009 03:29 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If you've got the data in different rows, then you need to look at LEAD and LAG
Previous Topic: Getting this issue
Next Topic: Cartesian join (merged 3)
Goto Forum:
  


Current Time: Thu Dec 08 16:30:33 CST 2016

Total time taken to generate the page: 0.08612 seconds