Last active
October 27, 2018 07:25
-
-
Save justdoit0823/110f3c2b98ebbe9d072fd3f7e3c0dbc8 to your computer and use it in GitHub Desktop.
mysql auto increment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop table if exists s_test_mysql_auto_increment; | |
create table s_test_mysql_auto_increment(id int primary key auto_increment, value int); | |
insert into s_test_mysql_auto_increment(value) values (10000); | |
SELECT `AUTO_INCREMENT` | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME = 's_test_mysql_auto_increment'; | |
insert into s_test_mysql_auto_increment(value) values (10001); | |
SELECT `AUTO_INCREMENT` | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME = 's_test_mysql_auto_increment'; | |
insert into s_test_mysql_auto_increment(value) values (10002); | |
SELECT `AUTO_INCREMENT` | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME = 's_test_mysql_auto_increment'; | |
insert into s_test_mysql_auto_increment(id, value) values (1000, 10002); | |
SELECT `AUTO_INCREMENT` | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME = 's_test_mysql_auto_increment'; | |
insert into s_test_mysql_auto_increment(id, value) values (500, 10002); | |
SELECT `AUTO_INCREMENT` | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME = 's_test_mysql_auto_increment'; | |
insert into s_test_mysql_auto_increment(value) values (10002); | |
SELECT `AUTO_INCREMENT` | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME = 's_test_mysql_auto_increment'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment