Re: getting currval from a sequence

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: tony <tony(at)animaproductions(dot)com>
Cc: postgres list <pgsql-general(at)postgresql(dot)org>
Subject: Re: getting currval from a sequence
Date: 2002-02-11 13:46:11
Message-ID: 20020211134611.GB3472@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 11, 2002 at 11:42:31AM +0100,
tony <tony(at)animaproductions(dot)com> wrote:
>
> How does one get the last record from a series of records? I just need
> the id field which is a sequence field

select max(id) from whatever;
(This assumes the sequence hasn't rolled over.)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karel Zak 2002-02-11 13:47:17 Re: timespan_part()?
Previous Message Bruno Wolff III 2002-02-11 13:39:38 Re: Function to Pivot data