pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chandan_Kumaraiah <Chandan_Kumaraiah@satyam.com>
To: pgsql-sql@postgresql.org
Subject: equivalent of oracle rank() in postgres
Date: Mon, 21 Mar 2005 12:38:05 +0530
Message-ID: <2EB549AAAFEA264FA926269A5BD5E9EB14657F@certsrv.satyam.com> (raw)

 

Hi,

 

Jus wanted the equivalent for rank() as in tis example..

 

SELECT *
FROM (
  SELECT employee_id, last_name, salary,
  RANK() OVER (ORDER BY salary DESC) EMPRANK
  FROM employees)
WHERE emprank = 3;

 

Rgds,

Chandan

view thread (2+ messages)  latest in thread

Message-ID: <2EB549AAAFEA264FA926269A5BD5E9EB14657F@certsrv.satyam.com>
Permalink:  ../2EB549AAAFEA264FA926269A5BD5E9EB14657F@certsrv.satyam.com/
Also on:    postgresql.org/message-id/2EB549AAAFEA264FA926269A5BD5E9EB14657F@certsrv.satyam.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: Chandan_Kumaraiah@satyam.com
  Subject: Re: equivalent of oracle rank() in postgres
  In-Reply-To: <2EB549AAAFEA264FA926269A5BD5E9EB14657F@certsrv.satyam.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox