Replacement for Oracle's "ROWNUM" in Postgres

From: Csaba Nagy <nagy(at)domeus(dot)de>
To: "'pgsql-general'" <pgsql-general(at)postgresql(dot)org>
Subject: Replacement for Oracle's "ROWNUM" in Postgres
Date: 2002-12-19 16:58:26
Message-ID: 96D568DD7FAAAD428581F8B3BFD9B0F604DE96@goldmine.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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);

It is used to initialize a table with data.
Is there any way to get the same result in Postgres somehow ?
Of course there is always the possibility to do it in a loop and calculate
the dates in the program, but that sucks.

Thanks,
Csaba.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-12-19 17:01:21 Re: trouble caused by change in 7.3 handling of '' in
Previous Message Tom Lane 2002-12-19 16:47:40 Re: [pgsql-general] Daily Digest V1 #2891