Re: column alias and group by/having/order

From: Rod Taylor <pg(at)rbt(dot)ca>
To: Tomasz Myrta <jasiek(at)klaster(dot)net>
Cc: Lista dyskusyjna pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: column alias and group by/having/order
Date: 2004-02-13 14:09:05
Message-ID: 1076681344.10896.19.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> select val1+val2 as val
> from some_table
> group by val having val>1;
> ERROR: Attribute "val" not found
>
> Is it a bug or a feature?

It's a mis-feature that group by accepts aliases of the select list.

Having is proper.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2004-02-13 15:02:39 Re: arrays and polygons
Previous Message Rod Taylor 2004-02-13 13:57:50 Re: 7.4 - FK constraint performance