想要批量实现一个更新num的功能
目前想到的是用update的 case when
这是正常的sql语句
update tb_sku set num = num - #{num} where id = #{id} and num >= #{num}
这是我想实现批量操作的sql语句
update tb_sku set num = case when id = #{id} then num - #{num} end where id in (#{id}) and num >=#{num}
我最后的更新条件num>#{num}怎么操作才能变成批量
单条件怎么批量??
num>(1,2,3,4)这样?