ITPub博客

首页 > 数据库 > PostgreSQL > PostgreSQL/Oracle 时间改成秒

PostgreSQL/Oracle 时间改成秒

原创 PostgreSQL 作者:哎呀我的天呐 时间:2022-07-27 19:16:57 0 删除 编辑
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}


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29990276/viewspace-2907893/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
https://cloud.tencent.com/developer/inventory/14362

注册时间:2014-10-30

  • 博文量
    403
  • 访问量
    2528861