From: Carsten Pedersen Date: December 27 2009 10:10pm Subject: Re: last_insert_id List-Archive: http://lists.mysql.com/mysql/219935 Message-Id: <4B37DB40.1000002@bitbybit.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Gary Smith skrev: ... > An example of where it wouldn't be: Although ID is auto_increment, you > could define a row as, say, '10005583429'. This would be a valid input. > Selecting max(id) would return that number. However, auto_increment > wouldn't change - it would still be '34' (or whatever) for the next > line. Not quite... CREATE TABLE t (id bigint unsigned primary key auto_increment); INSERT INTO t VALUES (10005583429); INSERT INTO t VALUES (null); SELECT * FROM t; +-------------+ | id | +-------------+ | 10005583429 | | 10005583430 | +-------------+ 2 rows in set (0.00 sec) / Carsten