Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: update column using specific order

Re: update column using specific order

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Wed, 03 Mar 2004 09:06:55 -0800
Message-ID: <1078333581.19828@yasure>


Brovreizh wrote:

> Hi all,
>
> I would like to populate a given column in a table like this:
>
> Name Salary SalaryRank
> ---- ------- --------
> Smith 100000
> John 350000
> McDo 220000
> Corny 110000
>
> And finally obtain in the SalaryRank, the rank of the salary comparing
> to all the salary in this table like this:
>
> Name Salary SalaryRank
> ---- ------- --------
> Smith 100000 4
> John 350000 1
> McDo 220000 2
> Corny 110000 3
>
> Is it possible using an update command ?
> Thanks.

Yes. Use the rank operator.
http://www.psoug.org/reference/rank.html

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Wed Mar 03 2004 - 11:06:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US