| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Carsten Pedersen | Date: | December 27 2009 10:10pm |
| Subject: | Re: last_insert_id | ||
| View as plain text | |||
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
| Thread | ||
|---|---|---|
| • last_insert_id | Victor Subervi | 27 Dec |
| • Re: last_insert_id | Mattia Merzi | 27 Dec |
| • Re: last_insert_id | Victor Subervi | 27 Dec |
| • Re: last_insert_id | Michael Dykman | 27 Dec |
| • Re: last_insert_id | Victor Subervi | 27 Dec |
| • Re: last_insert_id | Gary Smith | 27 Dec |
| • Re: last_insert_id | Victor Subervi | 27 Dec |
| • Re: last_insert_id | Carsten Pedersen | 27 Dec |
| • Re: last_insert_id | Steve Edberg | 27 Dec |
| • Re: last_insert_id | Gary Smith | 27 Dec |
| • Re: last_insert_id | Mark Goodge | 27 Dec |
