主键后MYSQL语法错误

问题描述 投票:0回答:1

试图运行这个mysql:

DROP TABLE IF EXISTS Student;
CREATE TABLE IF NOT EXISTS Student
(
StudentID int(4) NOT NULL PRIMARY KEY, 
Read decimal(2,1) NOT NULL
);

但我一直得到错误:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Read decimal(2,1) NOTNULL)' at line 4

任何帮助都非常感谢。

mysql syntax
1个回答
0
投票

qazxsw poi是一个保留的关键字,所以请更改它或逃避它

试试这个

READ
© www.soinside.com 2019 - 2024. All rights reserved.