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: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT DISTINCT ON bug?
Date: 2003-05-21 09:58:26
Message-ID: Pine.LNX.4.21.0305211053310.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:

> Nigel J. Andrews wrote:
> >>
> >>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.
>
> You mean "after the *" right? ;)

No, I was refering to the syntax you'd pasted from psql:

Syntax:
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
* | expression [ AS output_name ] [, ...]

Here the '*' I mention is on the second line of the statement and specifies the
returned columns. Before that point the only comma that can occur is within
the brackets giving the expression(s) of the DISTINCT ON.

Sorry for confusing you more.

>
> After looking at it again I see how I misunderstood the syntax...

Easily done.

--
Nigel J. Andrews

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Madhavi Daroor 2003-05-21 10:57:32 TIMESTAMP SUBTRACTION
Previous Message Simon Heinrich 2003-05-21 09:18:42 get SYSID of current user as var for query