check the manual that corresponds to your MySQL server version for the right syntax to use near

我会带着你远行 2021-07-26 14:40 406阅读 0赞
  1. <update id="updateWarehouseResources" parameterType="java.util.Map">
  2. update nddp_test.config_warehouse_resources
  3. <trim prefix="set" suffixOverrides=",">
  4. <if test="name != null"> name=#{name}, </if>
  5. <if test="order != null"> order=#{order}, </if>
  6. <if test="offline != null"> offline=#{offline}, </if>
  7. <if test="repair != null"> repair=#{repair}, </if>
  8. </trim>
  9. where id = #{id}
  10. </update>
  1. ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'order='4800',
  2. offline='3800',
  3. repair='77'
  4. whe' at line 3

注意这种一般情况下是语法问题,说明mysql的各种语句还是不够熟练,

(1)看表名是不是使用了Mysql的关键字,如果是,请立马改掉;(我的错误使用了MySQL的关键字!)

(2)语句给出哪里错误,如我的题目中给出“near”,说明在那附近有问题,或者在where前多加了逗号,去掉就行了

发表评论

表情:
评论列表 (有 0 条评论,406人围观)

还没有评论,来说两句吧...

相关阅读