qfedu-linux-advanced-level/day9/update_students.sql

21 lines
335 B
MySQL
Raw Normal View History

2023-08-24 17:18:04 +08:00
-- 修改测试
update t_stu
set sex='',birthday='1998-02-15'
where name = '刘红';
update t_stu
set sex='',birthday='1990-12-28'
where sid = 1;
update t_stu
-- set birthday=CURDATE()
set birthday=null
where sid = 5;
/*
update t_stu
-- 使用函数加 5 天
set birthday = DATE_ADD(birthday,INTERVAL 5 DAY)
where sid = 2;
*/