Re: Line Numbering in SELRCT Output

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Line Numbering in SELRCT Output
Дата
Msg-id 20020313165826.S90759-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: Line Numbering in SELRCT Output  (Hubert Palme <hubert.palme@web.de>)
Список pgsql-sql
On Mon, 11 Mar 2002, Hubert Palme wrote:

> Paul wrote:
>
> > CREATE SEQUENCE seq1;
> >
> > SELECT nextval('seq1'), amname FROM pg_am;
> >
> > DROP SEQUENCE seq1;
> >
>
> Hmm... I forgot to mention that my SELECT statement has an ORDER BY clause.
> The sort is done after the sequence numbers being generated. So the order
> of the sequence numbers becomes damaged by the sort.
>
> Is there any hint how to avoid this?

select nextval('seq1'), foo.* from (select ...) foo;



В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Casting
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: [INIMSS] How to use OID?