Tom Lane wrote:
> "A. Kretschmer" <[EMAIL PROTECTED]> writes:
>> am  Mon, dem 30.04.2007, um 15:45:18 +0200 mailte Heiko Klein folgendes:
>>> How can I do the following:
>>>
>>> select * from myvals, sum_n_product(myvals.x, myvals.y);
> 
>> select x, y, sum_n_product(x,y) from myvals;

> regression=# select x,y,(f).* from
> regression-#   (select *, sum_n_product(x,y) as f from myvals offset 0) ss;

If you really just want to calculate product and sum, it may be easier
to write just:

select x, y, x + y as sum, x * y as prod from myvals;

No need for fancy SP's in that case.
-- 
Alban Hertroys

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

Reply via email to