标签:class username use name password date 单表 lang 更新
单表更新,一定要加where,否则更新全表数据
update user
set username=‘hahah‘, password=‘666666‘, name=‘哈哈哈‘
where id=16;
多表更新
-- 修改财务部的密码
-- sql92
update user t1, department t2
set t1.password = ‘666666‘
where t1.department_id = t2.id
and t2.name = ‘财务‘;
-- sql99
update user t1
join department t2
on t1.department_id = t2.id
set t1.password=‘888888‘
where t2.name = ‘财务‘;
标签:class username use name password date 单表 lang 更新
原文地址:https://www.cnblogs.com/qixioa/p/13669942.html