保存返回到插入张扬的数据saveOrUpdate无效 保存方法更适合插入的决心,需要插入到数据和主键 saveOrUpdate更倾向于缺乏插入或更新,而你不并不需要得到主键 另...
mysql没有提供直接的方法来实现批量,但可以使用case when语法来实现这个功能。
update course
set name = case id
when 1 then 'name1'
when 2 then 'name2'
when 3 then 'name3'
end,
title = case id
when 1 then 'new title 1'
when 2 then 'new title 2'
when 3 then 'new title 3'
end
where id in (1,2,3)
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....