修改单表记录 update table_name ser column1=value1,column2=value2,… where 筛选条件**
修改多表的记录 sql92语法: update table_name1 别名,table_name2 别名 set 列=值 ,… where 连接条件 and 筛选条件; sql99语法: update table_name1 别名, inner|left|right join table_name2 别名 on 连接条件 set 列=值 ,… where 筛选条件
2 案例
修改beauty表中姓唐的女神的电话为13888888899
update beauty
set phone='13888888899'where name like'唐%';
修改多表记录 修改张无忌的女朋友的手机号为114
update boys bo
innerjoin beauty b on bo.id=b.boyfriend.id
set b.phone='114'where bo.boyName='张无忌';
修改没有男朋友的女神的男朋友的编号为2号
update boys bo
rightjoin beauty b on bo.id=b.boyfriend.id
set b.boyfriend_id=2where bo.id isnull;