Re: returning row numbers in select - Mailing list pgsql-general

From Chris
Subject Re: returning row numbers in select
Date
Msg-id 1078952905.6547.66.camel@dell
Whole thread Raw
In response to returning row numbers in select  (Randall Skelton <skelton@brutus.uwaterloo.ca>)
Responses Re: returning row numbers in select
List pgsql-general
> I to return a sequential row number beginning at 1?
>
> i.e.
>
> row|         timestamp
> ---+----------------------------
> 1   2004-02-01 23:15:00.824-05
> 2   2004-02-01 23:15:01.824-05
> 3   2004-02-01 23:15:02.824-05
> ...
>
> My reason for wanting row numbers is so I can use a 'MOD(row_number,
> n)' to get the nth row from the table.


Doesn't LIMIT and OFFSET do the job?
http://www.postgresql.org/docs/7.3/interactive/queries-limit.html


Bye, Chris.



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: postgres FROM clause problem
Next
From: Bruno Wolff III
Date:
Subject: symbolic links for 7.4.2