Tom Lane wrote: > "A. Kretschmer" <andreas.kretschmer@xxxxxxxxxxxxxx> 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