[SQL]CREATE TABLE "up_book" ( `id` INTEGER NOT NULL, `user_name` VARCHAR NOT NULL, `book_name` VARCHAR NOT NULL, `book_list` VARCHAR NOT NULL, `book_author` VARCHAR NOT NULL, `book_desc` VARCHAR NOT NULL, `book_content` VARCHAR NOT NULL, PRIMARY KEY("id") ); [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 '"up_book" ( `id` INTEGER NOT NULL, `user_name` VARCHAR NOT NULL, `book_nam' at line 1帮我修改错误
时间: 2023-11-21 10:09:18 浏览: 106
jsp连接sql_server2005数据库.doc 全解
在 MySQL 中,使用双引号来包含表名和列名是不被允许的,应该使用反引号(`)来代替。
以下是修改后的 SQL 语句:
```
CREATE TABLE `up_book` (
`id` INTEGER NOT NULL,
`user_name` VARCHAR(255) NOT NULL,
`book_name` VARCHAR(255) NOT NULL,
`book_list` VARCHAR(255) NOT NULL,
`book_author` VARCHAR(255) NOT NULL,
`book_desc` VARCHAR(255) NOT NULL,
`book_content` VARCHAR(255) NOT NULL,
PRIMARY KEY(`id`)
);
```
注意:VARCHAR 需要指定长度,这里假定最大长度为 255。你可以根据实际需求进行调整。
阅读全文