On Mon, Sep 01, 2003 at 13:34:32 +0300,
Andrei Verovski <andreil1@mail.starlett.lv> wrote:
>
> Anyone knows how to obtain last inserted serial (autoincrement) id? I
> am currently using "SELECT id FROM table_name ORDER BY id DESC", and
> then retrieve first row and desired value.
How you want to do this, depends on what you what to do with the number.
Normally if you just inserted a record that would create a new id and you
want to use that id to enter in another table, then you want to call
currval.