-1

我是Mysql的新手,在创建表时出错,请告诉我,

询问

CREATE  TABLE schoolsy.Employees (

Emp_Num               INT(11)  NOT NULL AUTO_INCREMENT,

Emp_First_Name    VARCHAR(30),

Emp_Last_Name    VARCHAR(30),

Emp_Middle_Name VARCHAR(30),

Emp_Gender            ENUM('M','F', 'N'),

Emp_Hire_Date      DATE,

Emp_End_Date      DATE,

Emp_Status             CHAR(1),

Row_Create_Ts    TIMESTAMP,

Row_Create_UserId  CHAR(30),

Row_Update_Ts    TIMESTAMP,

Row_Update_UserId CHAR(30) 

  PRIMARY KEY (Emp_Num)

COMMENT = 'This table contains all the employee details.';

新错误:

ERROR 1064:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在 '='This table contains all the employee details.'' 附近使用正确的语法,第 15 行

SQL 语句:

CREATE  TABLE schoolsy.Employees (

Emp_Num               INT(11)  NOT NULL AUTO_INCREMENT,

Emp_First_Name    VARCHAR(30),

Emp_Last_Name    VARCHAR(30),

Emp_Middle_Name VARCHAR(30),

Emp_Gender            ENUM('M','F', 'N'),

Emp_Hire_Date      DATE,

Emp_End_Date      DATE,

Emp_Status             CHAR(1),

Row_Create_Ts    TIMESTAMP,

Row_Create_UserId  CHAR(30),

Row_Update_Ts    TIMESTAMP,

Row_Update_UserId CHAR(30),

  PRIMARY KEY (Emp_Num),

COMMENT = 'This table contains all the employee details.'
4

1 回答 1

0

缺少逗号:

Row_Update_UserId CHAR(30),
                          ^--- here
  PRIMARY KEY (Emp_Num),
                       ^-- here
COMMENT = 'This table contains all the employee details.';
        ^--- remove
于 2012-11-18T01:47:38.837 回答