RE: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING - Mailing list pgsql-hackers

From Ansley, Michael
Subject RE: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING
Date
Msg-id 1BF7C7482189D211B03F00805F8527F748C35C@S-NATH-EXCH2
Whole thread Raw
List pgsql-hackers
Yes, you are right, of course, it doesn't mean that it's incorrect.
However, assuming that Oracle adheres strictly to the standard (which is a
good, but not infallible, assumption), it means that we don't.  Of course,
we may just extend the standard, but in this particular area, I'm not sure
that it's a good idea, because it can be very confusing, and lead to
inadvertent mistakes, which can be very difficult to find.

MikeA

-----Original Message-----
From: Zeugswetter Andreas SB
To: 'Ansley, Michael'; 'pgsql-hackers@postgreSQL.org '
Sent: 99/12/16 06:22
Subject: AW: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING


> So, according to Oracle's view of the world, HAVING is orrect 
> because it
> rejects aliases, but GROUP BY is broken because it accepts them.

Just because it is more powerful than the standard does not mean it is
broken.
The only thing, that is broken is that the alias is taken before the
colname,
and thus results in wrong output for a standard conformant query.

Andreas


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] NOTICE: LockRelease: locktable lookup failed, no lock
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Prepared for LONG