Home > MySQL - Oracle > MySQL – Last AUTOINC-ID after INSERT


After you INSERT into a table in which there is an autoincrement ID field, you can find last given ID with the following SELECT command;

select @last_id := LAST_INSERT_ID();


select LAST_INSERT_ID();


Categories: MySQL - Oracle Tags:
  1. 24. January 2012 at 08:39

    you can use mysql_insert_id() function when you write program with php

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: