Re: sum of agreggates in one SELECT? - Mailing list pgsql-sql

From Louis-David Mitterrand
Subject Re: sum of agreggates in one SELECT?
Date
Msg-id 20000919220657.E557@styx
Whole thread Raw
In response to Re: sum of agreggates in one SELECT?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
On Tue, Sep 19, 2000 at 11:06:06AM -0700, Josh Berkus wrote:
> 
> Unfortunately, Louis-David, I don't see any way around subselects in the
> FROM clause as Tom mentions, which are not currently supported.  I'd
> suggest using a Function to create a temporary table or view and
> summarizing from that.

I did create a pl/pgsql function in the end, to compute my total:
        FOR bid IN SELECT max(b.lot) AS price               FROM bid b WHERE b.auction_id = $1 GROUP BY b.person_id
          LOOP               i := i + bid.price;           END LOOP;           RETURN i;
 

Thanks for your input,

-- 
Louis-David Mitterrand - ldm@apartia.org - http://www.apartia.org

"Faith strikes me as intellectual laziness." -- Robert A. Heinlein


pgsql-sql by date:

Previous
From: Louis-David Mitterrand
Date:
Subject: Re: sum of agreggates in one SELECT?
Next
From: Louis-David Mitterrand
Date:
Subject: no ORDER BY in subselects?