Re: Subqueries returning more than one value?

Поиск
Список
Период
Сортировка
От CoL
Тема Re: Subqueries returning more than one value?
Дата
Msg-id c7pb0g$690$1@news.hub.org
обсуждение исходный текст
Ответ на Subqueries returning more than one value?  (Adam Witney <awitney@sghms.ac.uk>)
Список pgsql-sql
hi,

Adam Witney wrote, On 5/11/2004 02:09:
> Hi,
> 
> I am using a function in a subquery, this works ok:
> 
> SELECT name, (SELECT p_my_func(1)) AS id
>   FROM test;
> 
> However I would like to have the function return 2 values into the main
> query... Something like this:
> 
> SELECT name, (SELECT p_my_func(1)) AS (id, type)
>   FROM test;
> 
> Of course this gives the error:
> 
> ERROR:  subquery must return only one column
> 
> Is there any way around this?

SELECT name,t.*  FROM (SELECT p_my_func(1)) AS t(id, type), test

C.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Willem de Jong
Дата:
Сообщение: Seconds To Time
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: Info