Re: why the difference?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: why the difference?
Дата
Msg-id 11686.1037890040@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: why the difference?  (Jakub Ouhrabka <jouh8664@ss1000.ms.mff.cuni.cz>)
Список pgsql-sql
Jakub Ouhrabka <jouh8664@ss1000.ms.mff.cuni.cz> writes:
> the where clause is evaluated before the distinct clause, so your queries
> aren't equivalent because you switched the order by splitting the query
> into two queries...

Besides which, SELECT DISTINCT ON is order-sensitive.  If you don't use
an ORDER BY with it, you are going to get rather unpredictable results.
See the example on the SELECT reference page.
        regards, tom lane


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

Предыдущее
От: "Peter Galbavy"
Дата:
Сообщение: help optimise this ?
Следующее
От: "Henshall, Stuart - Design & Print"
Дата:
Сообщение: Re: help optimise this ?