Oracle:
当前时间 + 10秒,
select to_char(sysdate + interval '10' second, 'yyyy-mm-dd hh24:mi:ss') reqDate from dual;
当前时间 + 10分,
select to_char(sysdate + interval '10' minute, 'yyyy-mm-dd hh24:mi:ss') reqDate from dual;
当前时间 + 10时,
select to_char(sysdate + interval '10' hour, 'yyyy-mm-dd hh24:mi:ss') reqDate from dual;
当前时间 + 10天,
select to_char(sysdate + interval '10' day, 'yyyy-mm-dd hh24:mi:ss') reqDate from dual;
PostgreSQL :
当前时间 + 10秒,
select to_char(now() + interval '10 second', 'yyyy-mm-dd hh24:mi:ss') reqDate from csp_phase_code_history;
当前时间 + 10分,
select to_char(now() + interval '10 minute', 'yyyy-mm-dd hh24:mi:ss') reqDate from csp_phase_code_history;
当前时间 + 10时,
select to_char(now() + interval '10 hour', 'yyyy-mm-dd hh24:mi:ss') reqDate from csp_phase_code_history;
当前时间 + 10天,
select to_char(now() + interval '10 day', 'yyyy-mm-dd hh24:mi:ss') reqDate from csp_phase_code_history;
注意Oracle、PostgreSQL增减时间的单引号范围不一样,比如:
select to_char(sysdate + interval '10' day, 'yyyy-mm-dd hh24:mi:ss') reqDate from dual;
select to_char(now() + interval '10 day', 'yyyy-mm-dd hh24:mi:ss') reqDate from csp_phase_code_history;