Re: find position of row in set of rows

From: Mark D Powell <>
Date: Thu, 28 Jan 2010 11:04:15 -0800 (PST)
Message-ID: <>

On Jan 28, 1:49 pm, cate <> wrote:
> I have a table ordered by date.  When I find a specific record in this
> set, I want to know what its position is in this ordered list.
> I could get the date from the record found and count dates above or
> below, but is there a better way?
> Thank you.

Look up the rownum psuedo column in your SQL manual.

Basically select rownum, date_col from ( select date_code from t order by 1 )

HTH -- Mark D Powell -- Received on Thu Jan 28 2010 - 13:04:15 CST

Original text of this message