CREATE TABLE DEPARTMENT (
DEP_ID INT(4) DEFAULT '0' NOT NULL ,
SUPER_DEP_ID INT(4) DEFAULT '0' NOT NULL ,
DEP_NAME CHAR(20) DEFAULT '' NOT NULL,
DEP_DESC CHAR(40) DEFAULT '' NOT NULL,
PRIMARY KEY(DEP_ID),
foreign key dddd(super_dep_id) references department (dep_id) on delete set default);
我想实现DEP_ID和SUPER_DEP_ID关联的外键功能,可能是写错了,请帮我检查一下最后的一行语法,万分感谢!!!
DEP_ID INT(4) DEFAULT '0' NOT NULL ,
SUPER_DEP_ID INT(4) DEFAULT '0' NOT NULL ,
DEP_NAME CHAR(20) DEFAULT '' NOT NULL,
DEP_DESC CHAR(40) DEFAULT '' NOT NULL,
PRIMARY KEY(DEP_ID),
foreign key dddd(super_dep_id) references department (dep_id) on delete set default);
我想实现DEP_ID和SUPER_DEP_ID关联的外键功能,可能是写错了,请帮我检查一下最后的一行语法,万分感谢!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货