Re: [SQL] Returning multiple rows in functions

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [SQL] Returning multiple rows in functions
Дата
Msg-id Pine.LNX.4.21.0003061723580.362-100000@localhost.localdomain
обсуждение исходный текст
Ответ на Returning multiple rows in functions  (Kief Morris <k.morris@bitbull.com>)
Список pgsql-sql
Kief Morris writes:

> I create the following function:
> 
>     create function getid (int4) returns text as 'select name from mytable
> where id = $1;' language 'sql';
> 
> ... but it only returns the first matching row. Is there
> a way to return all the matching rows?

No. Perhaps making a view would fit your application.

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



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

Предыдущее
От: Kief Morris
Дата:
Сообщение: Returning multiple rows in functions
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: [SQL] index file's growing big