Re: SELECT DISTINCT ON bug?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>, Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>, pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT DISTINCT ON bug?
Date: 2003-05-22 17:34:36
Message-ID: 20030522173436.GA9623@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 22, 2003 at 11:05:20 -0600,
"scott.marlowe" <scott(dot)marlowe(at)ihs(dot)com> wrote:
> On Thu, 22 May 2003, Bruno Wolff III wrote:
>
> > On Thu, May 22, 2003 at 08:53:10 -0600,
> > "scott.marlowe" <scott(dot)marlowe(at)ihs(dot)com> wrote:
> > >
> > > Wouldn't we also need them around the expression on the select line?
> > >
> > > SELECT [ ALL | DISTINCT [ ON {( expression [, ...] ) } ] ]
> > > { * | expression [ AS output_name ] [, ...] }
> >
> > I don't think so. Where you put them you have enclosed tokens that
> > are only concatenated so precedence doesn't cause a problem.
> > The original format implies that you can have a select statement without
> > the SELECT keyword and that if you use the SELECT keyword you also have
> > to use * for the target list.
>
> sorry, I meant to put them inside the | symbol on the left.
>
> * | { expression...
>
> And I'm pretty sure I put them in the wrong place on the top line too.

On the first line the alternation is enclosed in []s so there isn't
a problem. The meaning is correct in that you can't use the ON keyword
if you used ALL.
On the second line you don't need to enclose the right hand side of
the alternation in {}s because the terms are all connected by
concatenation.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-05-22 18:05:46 Re: SELECT DISTINCT ON bug?
Previous Message scott.marlowe 2003-05-22 17:05:20 Re: SELECT DISTINCT ON bug?