how to do a select distinct within pgplsql

Started by Feite Brekeveldabout 25 years ago1 messagesgeneral
Jump to latest
#1Feite Brekeveld
feite.brekeveld@osiris-it.nl

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