javaEEday07-DML-SQL-update

This commit is contained in:
xx
2026-10-11 11:19:15 +08:00
parent a1bc25eb63
commit eea26bafd0
+8 -1
View File
@@ -42,4 +42,11 @@ values
('wuji2','张无忌2',1,now(),now()),
('wuji3','张无忌3',1,now(),now()),
('wuji4','张无忌4',1,now(),now())
;
;
-- DML : 更新数据 - update
-- 1. 将 tb_emp 表的ID为1员工 姓名name字段更新为 '张四'
update tb_emp set name = '张四' where id = 1;
update tb_emp set name = '张四' ;
-- 2. 将 tb_emp 表的所有员工的入职日期更新为 '2010-01-01'
update tb_emp set entrydate='2010-01-01',update_time=now();