How to return a resultset/table from a sql function?

From: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>
To: "Pgsql-General (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: How to return a resultset/table from a sql function?
Date: 2005-01-12 20:48:48
Message-ID: A3D1526C98B7C1409A687E0943EAC41048A0AD@obelix.askesis.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is it possible to return the following (parameterized) qyery from a sql or plpsql function, and if so, what is the syntax?

SELECT{ (SELECT COUNT(klantnummer) FROM abo_klt WHERE abonnement = $1),
(SELECT SUM(aantal_abonnementen) FROM abo_klt WHERE abonnement = $1));

Groeten,

Joost

Browse pgsql-general by date

  From Date Subject
Next Message MargaretGillon 2005-01-12 20:59:28 Postgresql Text field / Visual FoxPro Memo and ODBC
Previous Message Ed L. 2005-01-12 20:30:46 Re: Postgresql didn't start after power failure