Sub-query as function argument

From: Michael Burke <michael(at)engtech(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Sub-query as function argument
Date: 2005-12-20 13:42:51
Message-ID: 200512200942.51624.michael@engtech.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is it possible to execute a SELECT query as an argument to a function?

Example:

SELECT my_func('Sample', NULL, SELECT MIN(year) FROM audio);

In my particular case, my_func inserts columns into another table; I wish to
use values from another table as the arguments. The interior SELECT will
return only a single value; perhaps it needs to be wrapped in another
function?

TIA.
Mike.

--
Michael Burke
michael(at)engtech(dot)ca

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jaime Casanova 2005-12-20 14:52:34 Re: Sub-query as function argument
Previous Message Aarni Ruuhimäki 2005-12-20 13:33:42 Re: Querying date_time for date only ?