Re: Embarassing GROUP question

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Embarassing GROUP question
Дата
Msg-id 20091003173126.GG5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Embarassing GROUP question  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Embarassing GROUP question
Список pgsql-general
On Sat, Oct 03, 2009 at 01:05:49PM -0400, Tom Lane wrote:
> What you might be after is something like Postgres' DISTINCT ON
> feature

Yup, looks that way to me as well.

> I have never really played around with this aspect of MySQL ...

Me neither.

> but looking at this example, and presuming that you find that
> it actually does something useful, I wonder whether they interpret
> the combination of GROUP BY and ambiguous-per-spec ORDER BY
> in some fashion similar to DISTINCT ON.

Yup, does look that way doesn't it.  It's still a weird pair of
semantics to conflate.

Hum, if they were assuming that you'd always have to implement GROUP BY
by doing a sort step first then I can see why they'd end up with this.
But if you want to do *anything* else (i.e. hash aggregate in PG) then
you want to keep the semantics of GROUP BY and ORDER BY separate as the
spec and indeed PG does.

--
  Sam  http://samason.me.uk/

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

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: Procedure for feature requests?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Procedure for feature requests?