Monday, 7 February 2011

Some say MySQL does not have any sequences

Not true, it's got only one, and it's per session:

select last_insert_id(last_insert_id() + 1);


To be reset like that:

select last_insert_id(0);

No comments:

Post a Comment