updata 和 insert 语句 每个月份的都不一样,用 sql 脚本我该怎么写,用不了代码。
一月的
插入:
INSERT INTO attendance_workday (date_ymd, is_work)
VALUES
('20240101', '1'),
('20240102', '1'),
('20240103', '1'),
('20240104', '1'),
('20240105', '1'),
('20240106', '0'),
('20240107', '0'),
('20240108', '1'),
('20240109', '1'),
('20240110', '1'),
('20240111', '1'),
('20240112', '1'),
('20240113', '1'),
('20240114', '0'),
('20240115', '1'),
('20240116', '1'),
('20240117', '1'),
('20240118', '1'),
('20240119', '1'),
('20240120', '0'),
('20240121', '0'),
('20240122', '1'),
('20240123', '1'),
('20240124', '1'),
('20240125', '1'),
('20240126', '1'),
('20240127', '0'),
('20240128', '0'),
('20240129', '1'),
('20240130', '1'),
('20240131', '1');
更新:
UPDATE attendance_workday SET date_ymd = '20240101', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240102', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240103', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240104', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240105', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240106', is_work = '0';
UPDATE attendance_workday SET date_ymd = '20240107', is_work = '0';
UPDATE attendance_workday SET date_ymd = '20240108', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240109', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240110', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240111', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240112', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240113', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240114', is_work = '0';
UPDATE attendance_workday SET date_ymd = '20240115', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240116', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240117', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240118', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240119', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240120', is_work = '0';
UPDATE attendance_workday SET date_ymd = '20240121', is_work = '0';
UPDATE attendance_workday SET date_ymd = '20240122', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240123', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240124', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240125', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240126', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240127', is_work = '0';
UPDATE attendance_workday SET date_ymd = '20240128', is_work = '0';
UPDATE attendance_workday SET date_ymd = '20240129', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240130', is_work = '1';
UPDATE attendance_workday SET date_ymd = '20240131', is_work = '1';
date_ymd, is_work, update, set