MySQL 5.1不支持IDENTITY语法吗?
SQL语句的开头是这样的:
CREATE TABLE TESTTABLE
(
ID INT IDENTITY(1, 1) PRIMARY KEY,
报错是这样的:
[MySQL][ODBC 5.1 Driver][mysqld-5.1.51-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTITY(1, 1) PRIMARY KEY, UUT_RESULT INT NOT NULL, STEP_PARENT INT, ORDER_NUMB' at line 1 (-2147217900)
请教各位,MySQL是不是不支持IDENTITY语法?
那么它对应的语法是不是AUTO_INCREMENT?
如果是AUTO_INCREMENT的话,是通过什么确定初始值呢?
------解决方案--------------------
CREATE TABLE TESTTABLE
(
ID INT AUTO_INCREMENT PRIMARY KEY)
------解决方案--------------------
初始值
alter table TESTTABLE AUTO_INCREMENT=2;
OR
CREATE TABLE TESTTABLE
(
ID INT AUTO_INCREMENT PRIMARY KEY) AUTO_INCREMENT=6
------解决方案--------------------
IDENTITY(1, 1)是sqlserver的写法 mysql写法是auto_increment