Oracle,sql Server,mysql's self-variable setting:
1, MySQL's own variable is relatively good to remember, using the Auto_increment keyword, if you know English is easy to remember, the following to create a table with self-change.
create table test(id int AUTO_INCREMENT
primary key not null,name varchar (50));
Note: The ID here must be declared as the primary key, otherwise it will be an error.
2, SQL Server using the IDENTITY keyword, you can easily specify from what number, the increase is as follows:
create table test(id int identity(100,10)
primary key not null,name varchar (50));
3. Oracle cannot specify an automatic keyword when creating a table, it needs to recreate the sequence, and then use the "Create key. Nextval" to refer to:
create table test(id int primary key
not null,name varchar(50));
create sequence test_id(最好是表名+序列号标记)
increment by 1 start with 1 maxvalue 9999;
The reference is as follows:
insert into test(test_id.nextval,'www');