update 表名
set 列=值,列=值...
实例
update student set `age`=32 where `id`=10;
Query OK, 1 row affected (0.01 sec)
记住我Rows matched: 1 Changed: 1 Warnings: 0
实例
update student
left join class on class.`id`=student.`class_id`
set student.`age`=25,class.`name`='班级⼀'
where student.`class_id`=1;
Query OK, 13 rows affected (0.01 sec)
Rows matched: 13 Changed: 13 Warnings: 0
发布评论