重庆思庄Oracle、Redhat认证学习论坛
标题:
PostgreSQL - 怎么将时间转换成秒
[打印本页]
作者:
郑全
时间:
2024-8-16 10:05
标题:
PostgreSQL - 怎么将时间转换成秒
使用
extract(epoch from 搞定:
select extract(epoch from(('2018-12-18 00:00:10'::timestamp - '2018-12-18 00:00:00')));
select extract(epoch from(('2018-12-18 00:00:10' - '2018-12-18 00:00:00'::timestamp)));
select extract(epoch from(('2018-12-18 00:00:10' - timestamp'2018-12-18 00:00:00')));
select extract(epoch from((timestamp'2018-12-18 00:00:10' - '2018-12-18 00:00:00')));
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/)
Powered by Discuz! X3.2