postgresq與mysql中timestampdiff(SECOND,字段,NOW())相同求時間差值的秒值 mysql中寫法:
select timestampdiff(SECOND,createtime,NOW()) from table1; postgresql: select extract(epoch FROM CURRENT_TIMESTAMP) - extract(epoch FROM createtime) from table1;
表:table1 字段:createtime 求創建時間與當前時間之間的差值轉換成秒值。