MySQL將指定的日期往後加幾天

2021-09-03 00:07:10 字數 1235 閱讀 8820

update t_security_work set alarm_time = date_add(alarm_time,interval 1 day) where id=4;

update 表名

set 列名 = date_add(列名,interval n day)

-- table "push_msg_overview" ddl

create table `push_msg_overview` (

`id` int(10) unsigned not null auto_increment,

`push_date` date not null comment '日期',

`project_type` tinyint(3) unsigned not null default '0' comment '專案型別 1 2~30天未啟動推送 2 30-60天未啟動 3 無限制推送 9 柚子街訊息 10 臨時推送(**推送) 11 手動推送',

`platform` tinyint(3) unsigned not null default '0' comment '推送平台 0 所有 2 ios 3 安卓',

`offset_day` tinyint(3) unsigned not null default '0' comment '距離推送日期天數 (0 當天統計) ',

`actual_push_count` int(10) unsigned not null default '0' comment '實際推送量',

`success_push_count` int(10) unsigned not null default '0' comment '成功推送量',

`arrived_count` int(10) unsigned not null default '0' comment '到達量',

`open_count` int(10) unsigned not null default '0' comment '開啟量',

primary key (`id`),

) engine=innodb auto_increment=2417 default charset=utf8mb4 comment='推送資料總覽';

select * from push_msg_overview where date_add( push_date ,interval offset_day day )= '2018-11-05'

mysql指定日期加

mysql時間加減函式為date add date sub 定義和用法 date add 函式向日期新增指定的時間間隔。date sub 函式向日期減少指定的時間間隔。語法date add date,interval expr type date sub date,interval expr typ...

怎麼用java將獲取的日期往後新增一天!

date date1 new date date date2 new date calendar calendar new gregoriancalendar calendar.settime date1 calendar.add calendar.date,1 把日期往後增加一天.整數往後推,負數...

Shell獲取指定日期對應的週幾

shell操作日期時,經常會遇到獲取某一日期所對應的本週的週幾,以獲取對應的本週週六為例,那如果獲取本週週六的日期,是比較簡單的,有直接的函式搞定,具體shell指令碼如下 current sat date with minus date d saturday y m d 但是有的時候為了實現動態化...