Thread: how to do a select distinct within pgplsql

how to do a select distinct within pgplsql

From
Feite Brekeveld
Date:
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.brekeveld@osiris-it.nl