Skip site navigation (1) Skip section navigation (2)

Re: How to use result column names in having cause

From: "Andrus" <eetasoft(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to use result column names in having cause
Date: 2006-03-31 13:05:53
Message-ID: e0j9fs$1stb$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-general
>> In real application I have long expression instead of 123 and do'nt want
>>  repeat this expression in HAVING clause.
>
> You have to repeat the expression. "AS" changes the output name, it
> can't be used either in the where clause or any other limiting factor
> like 'having':

Doc about HAVING condition says:

Each column referenced in condition must unambiguously reference a grouping 
colum

HAVING x> AVG(bar) unambiguously references to a grouping column x

Is this bug ? It is very tedious to repeat same column expression in a 
multiple times: one time in column expression, and n times in having clause.

Are there plans to fix this?

Andrus. 



In response to

Responses

pgsql-general by date

Next:From: AndrusDate: 2006-03-31 13:14:18
Subject: Re: How to use result column names in having cause
Previous:From: A. KretschmerDate: 2006-03-31 12:50:02
Subject: Re: how to use pg_dump in windows xp

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group