Re: AW: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>, "'pgsql-hackers(at)postgreSQL(dot)org'" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: AW: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING
Date: 1999-12-15 19:18:12
Message-ID: 3.0.1.32.19991215111812.010879c0@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 06:37 PM 12/15/99 +0100, Zeugswetter Andreas SB wrote:
>
>> Next question is, do we want to leave the code as-is, or tighten up
>> the parser to reject AS-names and column numbers in GROUP BY?
>
>The numbers are also allowed in other DBMS's, so I would leave that as is.

>From Oracle:

SQL> select i from foo group by i;

I
----------
1

SQL> select i from foo group by 1;
select i from foo group by 1
*
ERROR at line 1:
ORA-00979: not a GROUP BY expression

Oracle doesn't appear to allow column numbers here, FWIW and if we
care.

Which dbms's allow it? Or is there an error in my query (I don't
use column numbering, I'm into names myself)?

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew Hagerty 1999-12-15 19:40:32 Re: [HACKERS] postmaster dies (6.5.3)
Previous Message Don Baccus 1999-12-15 19:12:54 Re: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING