Re: getting the ranks of items

Поиск
Список
Период
Сортировка
От Harald Fuchs
Тема Re: getting the ranks of items
Дата
Msg-id pu3bt35j8e.fsf@srv.protecting.net
обсуждение исходный текст
Ответ на getting the ranks of items  (merlyn@stonehenge.com (Randal L. Schwartz))
Ответы Re: getting the ranks of items  (merlyn@stonehenge.com (Randal L. Schwartz))
Список pgsql-general
In article <427821D7.7070302@sysmaster.com>,
Lyubomir Petrov <lpetrov@sysmaster.com> writes:

> create sequence seq_tmp;
> select nextval('seq_tmp') as rank, a.id, a.name from (select id, name
> from t order by name desc) a;
> drop sequence seq_tmp;

Using a temporary sequence for that would avoid naming conflicts.

> P.S. I'm sure you can wrap it in plperl stored procedure :)

Yes, prepending the ranking column in the application would be more efficient.
I wonder whether Randall knows Perl? ;-)

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

Предыдущее
От: "Lipy Reis"
Дата:
Сообщение: Postgre 8.0 for Linux i586
Следующее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: getting the ranks of items