mysql 自关联表的创建
CREATE TABLE `menu` (
`menuid`? int(11) NOT NULL DEFAULT 0 ,
`menuname`? varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`menupath`? varchar(80) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL ,
`menutype`? varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL ,
`btnId`? varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL ,
`parentid`? int(11) NULL DEFAULT NULL ,
`order`? int(11) NULL DEFAULT NULL ,
PRIMARY KEY (`menuid`),
CONSTRAINT `FK_menu_id__1` FOREIGN KEY (parentid) REFERENCES `menu` (`menuid`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8
ROW_FORMAT=COMPACT
;