您的当前位置:首页You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

来源:锐游网

前言

使用SQLyog添加DOUBLE字段报错

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 ') NULL COMMENT '里程数' after `d_id`' at line 2
ALTER TABLE `enterprise_car`.`order` ADD  `o_mileage2` DOUBLE(2) NULL  AFTER `d_id`

原因一

SQL有问题
正确SQL格式
之前写只写了10,没有写精度
正确写法

 ALTER TABLE `enterprise_car`.`order` ADD COLUMN o_mileage DOUBLE(10,2) COMMENT '里程数'

注意SQL格式问题

原因二

关键字问题使用关键字就会 报错,加引号

UPDATE ORDER SET c_id=?, CONDITION=? WHERE (o_id = '2009')

UPDATE `order` SET c_id=?, `condition`=? WHERE (o_id = '2009')

原因三

SQL格式是真的有问题

UPDATE `order`  WHERE (o_id = '2009')
UPDATE `order` SET c_id=? WHERE (o_id = '2009')

因篇幅问题不能全部显示,请点此查看更多更全内容

Top