Re: Get last serial (autoincrement) value

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Get last serial (autoincrement) value
Дата
Msg-id 20030901190122.GA1782@wolff.to
обсуждение исходный текст
Ответ на Get last serial (autoincrement) value  (Andrei Verovski (aka MacGuru) <andreil1@mail.starlett.lv>)
Список pgsql-php
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.

В списке pgsql-php по дате отправления:

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: Get last serial (autoincrement) value
Следующее
От: "Edric Bulalacao"
Дата:
Сообщение: pg_connect problem