From: | jwieck(at)debis(dot)com (Jan Wieck) |
---|---|
To: | Andreas(dot)Zeugswetter(at)telecom(dot)at (ZEUGSWETTER Andreas IZ5) |
Cc: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] Some progress on INSERT/SELECT/GROUP BY bugs |
Date: | 1999-05-19 15:08:42 |
Message-ID: | m10k7xb-000EBdC@orion.SAPserv.Hamburg.dsh.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>
> > I still am unclear which of these are valid SQL:
> >
> > select a as b from test order by a
> > select a as b from test order by b
> >
> Both are valid, and don't forget the third variant:
>
> > select a as b from test order by 1
> >
> Andreas
>
I wonder why this should be valid. Consider the following
test case:
CREATE TABLE t1 (a int4, b int4);
SELECT a AS b, b AS a FROM t1 GROUP BY a, b;
Is that now GROUP BY 1,2 or BY 2,1? Without the grouping, it
is a totally valid statement because the column DISPLAY-names
given with AS don't affect the rest of it.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Meskes | 1999-05-19 15:13:52 | Re: [HACKERS] Current TODO list |
Previous Message | The Hermit Hacker | 1999-05-19 14:47:07 | Re: [HACKERS] PyGreSQL 2.4 |