Re: Replacement for Oracle's "ROWNUM" in Postgres - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: Replacement for Oracle's "ROWNUM" in Postgres
Date
Msg-id 3E0314C6.7602.E186EBA@localhost
Whole thread Raw
In response to Re: Replacement for Oracle's "ROWNUM" in Postgres  (Bill Gribble <grib@linuxdevel.com>)
List pgsql-general
On 19 Dec 2002 at 11:30, Bill Gribble wrote:

> On Thu, 2002-12-19 at 10:58, Csaba Nagy wrote:
> > This query is setting a date into a column for all the rows, starting with a
> > fixed date with 10 minutes intervals.
> >
> > UPDATE some_table
> > SET some_date_column = 'some_literal_date' + (ROWNUM / 144.0);
> One way:
>
> CREATE SEQUENCE dateseq;
>
> UPDATE some_table
> SET some_date_column = 'some_literal_date' +
>                        (nextval('dateseq') / 144.0)
>
> DROP SEQUENCE dateseq;

Or use OID..

Bye
 Shridhar

--
On-line, adj.:    The idea that a human being should always be accessible to a
computer.


pgsql-general by date:

Previous
From: Graham Leggett
Date:
Subject: Unable to format timestamp with time zone; internal coding error
Next
From: Michelle Konzack
Date:
Subject: How to backup a postgreSQL of 80 GByte ?