oracle查询出来的时间吸附为每5min

时间:2024-01-07 20:15:38

to_char(PACKET_TIME,'yyyy-mm-dd hh24:')||floor(to_char(PACKET_TIME,'mi')/5 )*5||':00' as start_time, //5min向前

//5min后,累加时间
SELECT to_char(SYSDATE+5/24/60,'yyyy-mm-dd hh24:mi:ss') from dual

如:

to_char(
to_date( to_char(start_time,'yyyy-mm-dd hh24:')||floor(to_char(start_time,'mi')/5 )*5||':00', 'yyyy-mm-dd hh24:mi:ss')+5/24/60,'yyyy-mm-dd hh24:mi:ss'
) as end_time