Re: Re: "Oracle's ROWNUM"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: "Oracle's ROWNUM"
Дата
Msg-id 11381.996450944@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: "Oracle's ROWNUM"  (Svenne Krap <usenet@krap.dk>)
Список pgsql-general
Svenne Krap <usenet@krap.dk> writes:
> I thought of the possibility to do something like

> select rownum as artistplacement, s.* from (select rownum as
> techplacement, * from ranking order by technical_points) order by
> s.artiste_points

This is an interesting example, but I do not believe that ROWNUM could
really be used that way.  You are assuming that ROWNUM is computed after
the rows are sorted --- but in fact SQL requires the target expressions
of a SELECT to be computed before ORDER BY is applied.  What would you
expect to happen with
    SELECT rownum, * FROM table ORDER BY 1

Does anyone know what the actual semantics of Oracle's ROWNUM are?

            regards, tom lane

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

Предыдущее
От: Svenne Krap
Дата:
Сообщение: Re: "Oracle's ROWNUM"
Следующее
От: Wayne Johnson
Дата:
Сообщение: alter user to change user's password returns pg_shadow: Permission denied.