PostgreSQL/Oracle 时间改成秒

来源:这里教程网 时间:2026-03-14 20:39:14 作者:
select 
ROUND(TO_NUMBER(SYSDATE - TO_DATE(max(END_TIME), 'yyyy-MM-dd HH24:mi:ss') ) * 24 * 60 ) as "interval",
count(1) as "times" from SYS_NOTIFY_SEND_LOG  where contact_type is null and message_id = #{messageId}
select 
extract(epoch from((SYSDATE - to_timestamp(max(end_time), 'yyyy-mm-dd hh24:mi:ss')))) as "interval",
count(1) as "times" 
from SYS_NOTIFY_SEND_LOG  where contact_type is null and message_id = #{messageId}

相关推荐