sql语句
SELECT EXTRACT(EPOCH FROM (TIMESTAMP '2017-12-16 12:21:13'- TIMESTAMP '2017-12-15 12:21:00'));
=>
86413
计算两个时间的差值更新另一个时间字段
UPDATE your_table
SET this_time=(EXTRACT(EPOCH FROM (time_a-time_b)));
SELECT EXTRACT(EPOCH FROM (TIMESTAMP '2017-12-16 12:21:13'- TIMESTAMP '2017-12-15 12:21:00'));
86413
UPDATE your_table
SET this_time=(EXTRACT(EPOCH FROM (time_a-time_b)));