Re: Column aliases for GROUP BY and HAVING

From: Rikard Bosnjakovic <rikard(dot)bosnjakovic(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Column aliases for GROUP BY and HAVING
Date: 2009-11-26 01:14:04
Message-ID: d9e88eaf0911251714j24716e15h28ea52c191f146f0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Nov 25, 2009 at 20:35, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Rikard Bosnjakovic 2009-11-26 01:22:32 Merging two GROUP BY-queries
Previous Message Kris Kewley 2009-11-26 00:47:06 Re: Column aliases for GROUP BY and HAVING