mysql初学者的小坑``和'' 的区别
来源:互联网 发布:一年java专业技能描述 编辑:程序博客网 时间:2024/05/16 18:59
先来看这段sql语句
create table 'product_info'(
'product_id' varchar(32) not null,
'product_name' varchar(64) not null comment '商品名称',
'product_price' decimal(8,2) not null comment '单价',
'product_stock' int not null comment '库存',
'product_description' varchar(64) '描述',
'product_icon' varchar(512) comment '小图',
'category_type' int not null comment '类目编号',
'create_time' timestamp not null default current_timestamp comment '创建时间',
'update_time' timestamp not null default current_timestamp on update current_timestamp
commont '修改时间',
primary key('product_id')
) comment '商品表';
乍一看这段代码是没问题的,但运行时它却会报错:
Error Code: 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 ''product_info'( 'product_id' varchar(32) not null, 'product_name' varchar(6' at line 1 0.000 sec
找了半天,原来是 ‘’ 和 `` 的 问题,其中 ‘’是用来引用插入的数据=或者填写注释等用的,而 `` 是用来标识表字段的。
- mysql初学者的小坑``和'' 的区别
- 初学者的小小结
- 初学者的小练
- 初学者的小错误
- 给初学者:堆和栈的区别
- C++primer初学者:对象和类的小应用
- 初学者的java小知识
- 初学者的疑问:ARM和LPC的区别?
- [初学者的困惑] 堆和栈的区别 (转)
- 初学者需要注意的undefine和null的区别
- 初学者来认识OLEDB和ODBC的区别
- 堆和栈的区别——给初学者
- 堆和栈的区别——给初学者
- 堆和栈的区别——给初学者
- 堆和栈的区别——给初学者
- C++和JAVA的区别 -- 给初学者看
- C++和JAVA的区别 -- 给初学者看
- (写给初学者)静态页面和动态页面的区别
- 牛客网-剑指offer-18-二叉树的镜像
- 通过修改别名,设置初步服务器的安全
- SQL视图的创建和使用
- 牛客网-剑指offer-19-顺时针打印矩阵
- 程序31
- mysql初学者的小坑``和'' 的区别
- 2017.9.14 dispatching 思考记录
- Oracle字符集GBK改为UTF-8
- HDU
- win32汇编无头文件编译成功
- 程序32
- 牛客网-剑指offer-20-包含min函数的栈
- Ubuntu 下实现FTP服务器,SSH服务器,邮件服务器,Web服务器(一)
- 1006. Sign In and Sign Out (25)