Re: Sub-query as function argument

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

On December 20, 2005 10:52 am, Jaime Casanova wrote:
> have you tried?

Yes:

=> SELECT my_func('Sample', NULL, SELECT MIN(year) FROM audio);
ERROR: syntax error at or near "SELECT" at character 32

PostgreSQL 7.4.9, myfunc is pl/pgsql.

Just found a working method, though:

=> SELECT my_func('Sample', NULL, MIN(year)) FROM audio [ WHERE ... ];

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-12-20 15:05:37 Re: Querying date_time for date only ?
Previous Message Jaime Casanova 2005-12-20 14:52:34 Re: Sub-query as function argument