在新建数据表的时候表名和列名不能有引号,带有引号就会报错没有引号就能创建成功不知道啥情况。

来源:2-6 SQL语法基础-创建及修改表

哈哈笑笑9632300

2021-06-27

在新建数据表的时候表名和列名不能有引号,带有引号就会报错没有引号就能创建成功不知道啥情况。
mysql> create table ‘my_user’(
‘id’ int not null auto_increment,
‘name’ varchar(200) unique not null,primary key (id)
);
ERROR 1064 (42000): 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 ‘‘my_user’(‘id’ int not null auto_increment, ‘name’ varchar(200) unique not null,’ at line 1

写回答

1回答

NavCat

2021-06-27

注意是反引号,键盘左上角那个键

0
0

Python操作三大主流数据库 实战网易新闻客户端

零基础快速进阶,专为只懂Python语法的同学设计

432 学习 · 116 问题

查看课程