Re: Column aliases for GROUP BY and HAVING - Mailing list pgsql-novice

From Rikard Bosnjakovic
Subject Re: Column aliases for GROUP BY and HAVING
Date
Msg-id d9e88eaf0911251714j24716e15h28ea52c191f146f0@mail.gmail.com
Whole thread Raw
In response to Re: Column aliases for GROUP BY and HAVING  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
On Wed, Nov 25, 2009 at 20:35, Tom Lane <tgl@sss.pgh.pa.us> wrote:

[...]
> HAVING is not included because (a) it wasn't historically, and (b)
> the use-case for a bare column alias in HAVING would be pretty small
> anyway.  Your example wouldn't work even if HAVING acted the same
> as GROUP BY/ORDER BY, since you didn't just write the alias but
> tried to compare it to something else.

Thank you for the explanation. I didn't fully understand the gory
details, but it's of use to know that I cannot refer to an alias.


--
- Rikard

pgsql-novice by date:

Previous
From: Kris Kewley
Date:
Subject: Re: Column aliases for GROUP BY and HAVING
Next
From: Rikard Bosnjakovic
Date:
Subject: Merging two GROUP BY-queries