Re: Possible parsing problem?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nolan(at)celery(dot)tssi(dot)com
Cc: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Re: Possible parsing problem?
Date: 2003-06-30 16:57:38
Message-ID: 15468.1056992258@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

nolan(at)celery(dot)tssi(dot)com writes:
> The following does NOT produce an error on the 'order by' clause,
> though perhaps it should?

> SELECT col, count(*) from table group by col order by count;

AFAICS that is 100% correct per SQL92, given that we assign the default
name of "count" to the second result column.

> (FWIW, Oracle and MySQL both generate an error.)

They probably assign some other name to the column. The spec leaves it
to the implementation what name to assign to output columns, except in
very trivial cases (or when you force the issue with AS).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-06-30 18:11:26 Re: PlPython
Previous Message Andrew Gould 2003-06-30 16:29:32 Re: Possible parsing problem?