how to do a select distinct within pgplsql - Mailing list pgsql-general

From Feite Brekeveld
Subject how to do a select distinct within pgplsql
Date
Msg-id 3ACB9886.67EE75F3@osiris-it.nl
Whole thread Raw
List 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.brekeveld@osiris-it.nl
 
 
 

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: php Compile question
Next
From: Martín Marqués
Date:
Subject: Re: Re: php Compile question