Re: [HACKERS] Views on aggregates - need assistence

Brett McCormick <brett@work.chicken.org>

From: Brett McCormick <brett@work.chicken.org>
To: "Vadim B. Mikheev" <vadim@sable.krasnoyarsk.su>
Cc: Jan Wieck <jwieck@debis.com>, PostgreSQL HACKERS <pgsql-hackers@postgreSQL.org>
Date: 1998-02-24T04:59:10Z
Lists: pgsql-hackers
Thank you for addressing this issue!  It has been bugging me for a
while.  Usually I just select into a new table and select from that
(but yes, it is multiple queries).  Normally I want to do something
like:

select bar,count(a.oid) as c from a,b where a.ab = b.bar and c > 1;

This actually seems to be a different issue with more complicated
unresolvable (?) problems, because you want a pre-result (per
combination of instances matched) where and a result where (per result
tuple)..  Is this possible to do using subqueries?  I'll try to find out.	

This might be totally unrelated, actually.  I do not know enough about
view system to understand unresolvable conflicts.

--brett


On Tue, 24 February 1998, at 09:29:25, Vadim B. Mikheev wrote:

> create view v as select x, sum(y) as sy from A group by x;
> select * from B, V where B.z = V.sy;
> 
> - how can we handle this (aggregates in WHERE) ?
> It seems that current VIEW implementation using RULEs has
> unresolvable problems :(
> 
> Vadim