Re: limitby without orderby

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: limitby without orderby
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C2049FCE76@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на limitby without orderby  (Rohan Malhotra <yourbuddyrohan@gmail.com>)
Список pgsql-general
Rohan Malhotra wrote:
> What is difference between
>

> select * from items order by random() limit 5;
>

> and
>

> select * items limit 5;
>

> my basic requirement is to get random rows from a table, my where clause will make sure I won't get
> same rows in repeated execution of above queries.

The second query will not return the rows in a randomized order, but rather
in the order they are found. You should use the first query.

Yours,
Laurenz Albe

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: why VOLATILE attribute is required?
Следующее
От: Eric Ridge
Дата:
Сообщение: OS X 10.7, psql, and tab completion?