0

为什么我会从此代码中收到此错误

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 服务器版本相对应的手册,以在第 1Category行的“UNSIGNED CHARACTER SET hp8 COLLATE hp8_bin NOT NULL, BLOB UNSIGNED NO”附近使用正确的语法

4

2 回答 2

2

去除那个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

于 2012-08-01T13:31:06.687 回答
0

它应该是:

`Catagory` BLOB NOT NULL

BLOB不能是正数也不能是负数(因为它不是数字)。

于 2012-08-01T13:47:48.447 回答