-- 更新 [修改] 数据 - update
-- 1. 将 tb_emp 表的 ID为1 员工 姓名name字段更新为 '张三'
-- update 表名 set 字段名 = 值1 , 字段2 = 值2 where条件;
update tb_emp set name = '张三' , update_time = now() where id = 1;
-- 2. 将 tb_emp 表的 所有员工 的入职日期更新为 '2010-01-01'
-- update 表名 set 字段名 = 值1 , 字段2 = 值2 ;
update tb_emp set entrydate = '2010-01-01', update_time = now();
sql更新操作语法
于 2024-05-12 14:57:54 首次发布