Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: update column using specific order
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