日期:2014-05-16  浏览次数:20687 次

mysql 自增 id

CREATE TABLE animals (

??? grp ENUM('fish','mammal','bird') NOT NULL,

??? id MEDIUMINT NOT NULL AUTO_INCREMENT,

??? name CHAR(30) NOT NULL,

??? PRIMARY KEY (grp,id)

);

ALTER TABLE tbl AUTO_INCREMENT = 1000000;


CREATE TABLE animals (

??? grp ENUM('fish','mammal','bird') NOT NULL,

??? id MEDIUMINT NOT NULL AUTO_INCREMENT,

??? name CHAR(30) NOT NULL,

??? PRIMARY KEY (grp,id)

)AUTO_INCREMENT = 1000000;