Search Postgresql Archives

Re: Column aliases in GROUP BY and HAVING

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-10-12 10:40:03 -0400, Tom Lane wrote:
> "Peter J. Holzer" <hjp-pgsql@xxxxxx> writes:
> > In the GROUP BY clause I can use the alias year which was defined
> > earlier in SELECT. 
> 
> This is a pretty unfortunate legacy thing that we support because
> backwards compatibility (and because "GROUP BY 1" is so frequently
> a handy shortcut).
[...]
> I think SQL versions newer than SQL92 disallow these references entirely.
> 
> (I'm being fairly brief here, but this has all been litigated multiple
> times before.  See the archives.)

That's ok, you've answered my question. Thanks.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@xxxxxx         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment: signature.asc
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux