Saeed
Saeed

Reputation: 5488

create table MariaDB

creating table in MariaDB

I want to create a table in MariaDB

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)
)

but I got this error :

#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 `

What is the problem?

Upvotes: 0

Views: 983

Answers (2)

newpeople
newpeople

Reputation: 336

From maria db:

Syntax

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

This construction is declared in the main language's structure so you cannot use the keyword match or any word that contains it.

Upvotes: 2

streetturtle
streetturtle

Reputation: 5840

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

Upvotes: 1

Related Questions