function returning multiple rows?

Поиск
Список
Период
Сортировка
От Patrik Kudo
Тема function returning multiple rows?
Дата
Msg-id 36BB12DC.A05D490B@partitur.se
обсуждение исходный текст
Список pgsql-sql
Hello,

I've been trying to create a function which returns multiple rows, but I
can't get it working. I'm I doing something wrong, or is it not
possible? This is my setup:

create table groups (userid int4, grp int4);

CREATE FUNCTION usersingroup(int4) RETURNS int4 AS 'SELECT userid FROM
groups WHERE grp = $1;' LANGUAGE 'sql';


When doing a

SELECT usersingroup(100);

I only get the first row. Is there any way to get all the rows?

Regards,
Patrik Kudo
kudo@partitur.se

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

Предыдущее
От: George Moga
Дата:
Сообщение: Re: [SQL] date column
Следующее
От: Patrik Kudo
Дата:
Сообщение: Function returning multiple rows?