为什么我从此代码
中收到此错误CREATE TABLE `a9311211_AppBook`.`Requests`
(
`Name` VARCHAR( 15 ) UNSIGNED CHARACTER SET hp8 COLLATE hp8_bin NOT NULL ,
`Category` BLOB UNSIGNED NOT NULL ,
`Dificulty` FLOAT( 2 ) UNSIGNED NOT NULL ,
`Discription` LONGTEXT UNSIGNED CHARACTER SET hp8 COLLATE hp8_bin NOT NULL
) ENGINE = MYISAM CHARACTER SET hp8 COLLATE hp8_bin
MySQL说:
#1064 - 您的SQL语法有错误;查看与您的MySQL服务器版本对应的手册,以便在'UNSIGNED CHARACTER SET附近使用正确的语法hp8 COLLATE hp8_bin NOT NULL,Category
BLOB UNSIGNED NO'在第1行
答案 0 :(得分:1)
删除unsigned
CREATE TABLE `a9311211_AppBook`.`Requests` (
`Name` VARCHAR( 15 ) CHARACTER SET hp8 COLLATE hp8_bin NOT NULL ,
`Catagory` BLOB NOT NULL ,
`Dificulty` FLOAT( 2 ) UNSIGNED NOT NULL ,
`Discription` LONGTEXT CHARACTER SET hp8 COLLATE hp8_bin NOT NULL
) ENGINE = MYISAM CHARACTER SET hp8 COLLATE hp8_bin
只有数字类型可以是unsigned
答案 1 :(得分:0)
它应该是:
`Catagory` BLOB NOT NULL
BLOB
不能是正面也不是否定(因为它不是数字)。