CREATE TABLE 'product_category' (
'category_id' INT NOT NULL auto_increment,
'category_name' VARCHAR (64) NOT NULL COMMENT '类目名称,' || 'category_type' INT NOT NULL COMMENT '类目编号',
'create_time' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
'update_time' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY ('category_id'),
UNIQUE KEY 'uqe_category_type' ('category_type')
) COMMENT '类目表' ;
上面的建表语句在刚开始的时候我并没有觉得有神魔问题,你们觉得呢?
但是 运行时出现了
Err] 1064 - 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 ''product_category' (
'category_id' INT NOT NULL auto_increment,
'category_na' at line 1
意不意外,惊不惊喜!