SQL错误(1064):You have an error in your SQL syntax; check the manual that corresponds to your MySQL

错误信息

在 mysql 中,执行如下语句报错:

create table dx_dfs (
ID VARCHAR2(32) NOT NULL comment 'P',
Ywlx number(5) comment '业务类型',
Ywid VARCHAR2(32) comment '业务ID',
FsrID VARCHAR2(32) comment '发送人ID',
JsrID  VARCHAR2(32) comment '接收人ID',
Jsrsj VARCHAR2(32) NOT NULL comment '接收人手机',
Dxnr VARCHAR2(256) NOT NULL comment '短信内容',
Fsbs1 VARCHAR2(64) comment '发送标识1',
);

这个错误的信息如下:

SQL错误(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 ‘VARCHAR2(32) NOT NULL comment ‘P’,
Ywlx number(5) comment ‘业务类型’,
Ywid’ at line 2

MySql语法错误

解决方案

1064 错误码,就代表是语法错误,语法错误的范围非常广泛。我这里是关键字错误。

解决方法:

number 改成 numeric
varchar2 改成 varchar

如下:

create table dx_dfs (
ID VARCHAR(32) NOT NULL comment 'P',
Ywlx numeric(5) comment '业务类型',
Ywid VARCHAR(32) comment '业务ID',
FsrID VARCHAR(32) comment '发送人ID',
JsrID  VARCHAR(32) comment '接收人ID',
Jsrsj VARCHAR(32) NOT NULL comment '接收人手机',
Dxnr VARCHAR(256) NOT NULL comment '短信内容',
Fsbs1 VARCHAR(64) comment '发送标识1',
);
  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值