人大金仓数据库 日期计算
-- 减法 select date_format(now() - '1 HOUR'::interval , '%Y-%m-%d %H' ); select date_format(now() - '1 DAY'::interval , '%Y-%m-%d' ); select date_format(now() - '1 WEEK'::interval , '%Y-%m-%d' ); select date_format(now() - '1 MONTH'::interval , '%Y-%m-%d' ); select date_format(now() - '1 YEAR'::interval , '%Y-%m-%d' ); -- 加法 select date_format(now() - '-1 HOUR'::interval , '%Y-%m-%d %H' ); select date_format(now() - '-1 DAY'::interval , '%Y-%m-%d' ); select date_format(now() - '-1 WEEK'::interval , '%Y-%m-%d' ); select date_format(now() - '-1 MONTH'::interval , '%Y-%m-%d' ); select date_format(now() - '-1 YEAR'::interval , '%Y-%m-%d' );
'%Y-%m-%d %H:%i:%s'