[pgrouting-dev] Re: pgrouting-dev Digest, Vol 11, Issue 6

Jaime Casanova jaime at 2ndquadrant.com
Wed Apr 13 14:07:17 EDT 2011


On Wed, Apr 13, 2011 at 12:11 PM, cathal coffey <coffey.cathal at gmail.com> wrote:
>
> how do I
> extract the first and last item in a record set?
>

you mean a cursor inside plpgsql?

FETCH FIRST FROM cursor_name INTO some_var;
FETCH LAST FROM cursor name INTO some_var;

now the question is why aren't you using min() and max() in a select?

-- 
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL


More information about the pgrouting-dev mailing list