Re: Numbering rows by date - Mailing list pgsql-general

From Andrus
Subject Re: Numbering rows by date
Date
Msg-id ftcq98$lkd$1@news.hub.org
Whole thread Raw
In response to Numbering rows by date  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
Volkan,

> CREATE SEQUENCE document_docorder_seq START 1;
>
> UPDATE document
>   SET docorder = T.docorder
>  FROM (SELECT nextval('document_docorder_seq') AS docorder, docdate
>          FROM document
>         ORDER BY docdate) AS T
> WHERE document.docdate = T.docdate;
>
> DROP SEQUENCE document_docorder_seq;

thank you. Excellent.

Andrus.



pgsql-general by date:

Previous
From: Syra.Didelez@agfa.com
Date:
Subject: Silent install 8.3 diiffers from 8.2
Next
From: Giorgio Valoti
Date:
Subject: Functions and transactions