报错:
sql看起来是没有错得,allowMultiQueries参数也设置了,还是行
连接:
spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true
mapper:
<update id="updateInventoryOut" parameterType="com.rollout.srl.warehousing.model.Test">
<foreach collection="inventoryOut" item="item" index="index" open="" close="" separator=";">
update tb_inventory
<set>
equipment_status = #{item.equipmentStatus},
is_delete = #{item.isDelete}
</set>
where serial_no = #{item.serialNo}
ORDER BY updated_at desc
limit 1
</foreach>
</update>
路过得大佬帮忙看看,非常感谢
update语句不应该有order by
或者limit
这种操作吧。
update与order by 不能一起使用
大佬,还在吗 问题解决没,我现在也是批量更新一直报错,加上allowMultiQueries=true;也报错
我也是一样的还是报错已经一周了不知道怎么回事我就简单写了一个批量就一直报语法错
楼主解决了吗? 2022年2月19号 我的同学也遇到了这样的问题
你foreach的close没给分号“ ;” 你的sql语句只是间隔之间有“ ;” 但是结尾没有分号,因为是批量插入,所以对结尾是要有分号的,
我8.0也是报错
sql:update t_inventory_sn_basic SET mpn_no = ? where id = ?; update t_inventory_sn_basic SET mpn_no = ? where id = ?;
我也一样 楼主解决了吗
allowMultiQueries=true;批量更新,如果其中一条失败了会怎么样