how to do a select distinct within pgplsql

From: Feite Brekeveld <feite(dot)brekeveld(at)osiris-it(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: how to do a select distinct within pgplsql
Date: 2001-04-04 21:56:22
Message-ID: 3ACB9886.67EE75F3@osiris-it.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I want to do the following:

<snip>
create function ...
as
...

BEGIN

FOR myrec IN select distinct id from table where condition
LOOP

END LOOP;
END;

Now this doesn't work because the FOR IN statment expects a complete
record. How to deal with this ?
Tried CURSOR but that led to errors too.

Thanks,

--
Feite Brekeveld
feite(dot)brekeveld(at)osiris-it(dot)nl

Browse pgsql-general by date

  From Date Subject
Next Message David George 2001-04-04 22:01:28 Re: Postgres 7.1RC1 on Solaris 7
Previous Message Ahmed Moustafa 2001-04-04 21:22:16 Re: Postgres 7.1RC1 on Solaris 7