Re: Embarassing GROUP question

Поиск
Список
Период
Сортировка
Искать
От
Sam Mason
Тема
Re: Embarassing GROUP question
Дата
Msg-id
20091003173126.GG5407@samason.me.uk
Ответ на
Список
Дерево обсуждения
Re: Procedure for feature requests? Tim Landscheidt <tim@tim-landscheidt.de>
Re: Procedure for feature requests? Sam Mason <sam@samason.me.uk>
Re: Procedure for feature requests? Martin Gainty <mgainty@hotmail.com>
Re: Procedure for feature requests? Sam Mason <sam@samason.me.uk>
Re: Procedure for feature requests? Tom Lane <tgl@sss.pgh.pa.us>
Re: Procedure for feature requests? Sam Mason <sam@samason.me.uk>
Re: Procedure for feature requests? Tom Lane <tgl@sss.pgh.pa.us>
Re: Procedure for feature requests? Sam Mason <sam@samason.me.uk>
Embarassing GROUP question Corey Tisdale <corey@eyewantmedia.com>
Re: Embarassing GROUP question Tom Lane <tgl@sss.pgh.pa.us>
Re: Embarassing GROUP question Sam Mason <sam@samason.me.uk>
Re: Embarassing GROUP question Tom Lane <tgl@sss.pgh.pa.us>
Re: Embarassing GROUP question Corey Tisdale <corey@eyewantmedia.com>
Re: Embarassing GROUP question Tom Lane <tgl@sss.pgh.pa.us>
Re: Embarassing GROUP question Corey Tisdale <corey@eyewantmedia.com>
Re: Embarassing GROUP question Sam Mason <sam@samason.me.uk>
Re: Embarassing GROUP question Martin Gainty <mgainty@hotmail.com>
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
Дата:
От: Tom Lane
Дата:
FAQ