Re: SELECT DISTINCT ON bug?

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT DISTINCT ON bug?
Date: 2003-05-21 08:58:22
Message-ID: Pine.LNX.4.21.0305210956340.14538-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 21 May 2003, Jean-Christian Imbeault wrote:

> Martijn van Oosterhout wrote:
> >
> > Drop the comma after the distinct on.
> >
> > SELECT distinct on(dai_genres.id) dsc from dai_genres,
>
> Ok, that worked. But accroding to "\h select" the syntax is:
>
> SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
> * | expression [ AS output_name ] [, ...]
>
>
> I gather that to mean SELECT DISTINCT ON (*) , ...
>
> Is the syntax give by "\h select" wrong or am I misinterpreting it?

That's a misinterpretation I'm afraid. There is no comma shown before the *
that is not part of the expression for the DISTINCT ON.

--
Nigel J. Andrews

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Christian Imbeault 2003-05-21 09:17:02 Re: SELECT DISTINCT ON bug?
Previous Message Christopher Kings-Lynne 2003-05-21 08:49:10 Re: about NULL