数据库错误1064

数据库错误1064及解决

昨天在做后台管理项目时执行的代码

    <update id="updateUserMoney" parameterType="com.youyu.war.entity.po.UserPo">
        UPDATE user
        SET money = #{money},
        WHERE id = #{id};
    </update>

始终不能运行,当时给我的错误时:

SQL 错误 [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 'WHERE id = 1004' at line 3

在idea中改了一整天也没有成功修复这个bug,后来在dbeaver里用SQL编辑器查了一下,问题是我的MySQL语句有些问题,后来检查了一遍发现是money后面的“,”的问题,在下图的光标位置做出修改后问题解决了:

修改方法

posted @ 2022-12-20 14:22  公子有语  阅读(235)  评论(0)    收藏  举报