创建 table MariaDB

create table MariaDB

在 MariaDB 中创建 table

我想在 MariaDB

中创建一个 table
CREATE TABLE IF NOT EXISTS match
(
    a INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
    b INT NOT NULL,
    c INT NOT NULL,
    d INT NOT NULL,
    e INT NOT NULL,
    f INT NOT NULL,
    g VARCHAR(30)
)

但是我得到了这个错误:

#1064 - 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 'match ( a INT AUTO_INCREMENT NOT NULL PRIMARY KEY, b INT NOT NULL, ' at line 1 `

有什么问题?

Match是保留字(match against construction), so you cannot use it as table name. Check rule 18 here: https://mariadb.com/kb/en/sql-99/naming-rules/

来自玛丽亚数据库:

Syntax

MATCH (col1,col2,...) AGAINST (expr [search_modifier])

此结构在主要语言的结构中声明,因此您不能使用关键字 match 或任何包含它的词。