Re: sum of agreggates in one SELECT?

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема Re: sum of agreggates in one SELECT?
Дата
Msg-id 20000919220657.E557@styx
обсуждение исходный текст
Ответ на Re: sum of agreggates in one SELECT?  (Josh Berkus <josh@agliodbs.com>)
Список 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 по дате отправления:

Предыдущее
От: Louis-David Mitterrand
Дата:
Сообщение: Re: sum of agreggates in one SELECT?
Следующее
От: Louis-David Mitterrand
Дата:
Сообщение: no ORDER BY in subselects?