update: update 表 set 列=新值 where 筛选条件
"将表中id=1的name修改为aaa":
update 表 set name='aaa'
where id=1;
"将表中name有王字的name修改为aaa,age改为10":
update 表 set name='aaa',age=10
where name like '%王%';
“修改多表的记录”
"AB表连接,修改表记录":内连接
update 表A a #update 表 set xx where xx;
inner join 表B b
ON a.id = b.id
set b_name='sb',a_name='gd'
where a.id = 10;
"AB表连接,修改表记录":外连接
update 表A a
left outer join 表B b
on a.id = b.id
set a_name = 'aa',b_name = 'bb'
where b.id is null;