Home » SQL & PL/SQL » SQL & PL/SQL » how to get percentage on the row (oracle 9i)
how to get percentage on the row [message #432492] Tue, 24 November 2009 09:20 Go to next message
mosman
Messages: 9
Registered: April 2005
Junior Member
hi,

can any one help me to get percentage on the row
i have this table

date sales
31-01-2009 1000
28-02-2009 1500
31-03-2009 2750

i need percentage from the first month

Re: how to get percentage on the row [message #432499 is a reply to message #432492] Tue, 24 November 2009 09:42 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>i need percentage from the first month

what is correct formula to calculate desired results?

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.
Re: how to get percentage on the row [message #432500 is a reply to message #432492] Tue, 24 November 2009 09:42 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Show us the results you are expecting please.
Re: how to get percentage on the row [message #432502 is a reply to message #432492] Tue, 24 November 2009 09:52 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Have a look at RATIO_TO_REPORT function.

Regards
Michel
Re: how to get percentage on the row [message #432504 is a reply to message #432492] Tue, 24 November 2009 10:02 Go to previous messageGo to next message
mosman
Messages: 9
Registered: April 2005
Junior Member
THANKS A LOT
Re: how to get percentage on the row [message #432574 is a reply to message #432492] Wed, 25 November 2009 00:27 Go to previous messageGo to next message
mosman
Messages: 9
Registered: April 2005
Junior Member
resalt i expect like this

date sales raito from first row
31-01-2009 1000 1
28-02-2009 1500 1.5
31-03-2009 2750 2.75
Re: how to get percentage on the row [message #432585 is a reply to message #432574] Wed, 25 November 2009 00:52 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Use MIN in its analytic form (same book as the previous link).

Regards
Michel

[Updated on: Wed, 25 November 2009 01:43]

Report message to a moderator

Re: how to get percentage on the row [message #432588 is a reply to message #432585] Wed, 25 November 2009 01:13 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
If calculations have to be done relatvive to the first row, I'd say you'd need to use FIRST_VALUE().
Previous Topic: Integer Vs Number Datatype
Next Topic: UNIQUE CONSTRAINT
Goto Forum:
  


Current Time: Fri Feb 14 08:55:53 CST 2025