美文网首页
mysql更新表记录的前n条数据

mysql更新表记录的前n条数据

作者: 漩涡丶路飞 | 来源:发表于2018-12-03 15:55 被阅读0次

1.更新前10条记录

update student set name = '张三' order by id asc LIMIT 10;

2.可控更新页数

update student set name = '张三' where id in (select t.id from (select id from student LIMIT 0,10) t);

相关文章

网友评论

      本文标题:mysql更新表记录的前n条数据

      本文链接:https://www.haomeiwen.com/subject/buwycqtx.html