2020
12-27
12-27
postgresql 计算时间差的秒数、天数实例
处理时间时用到了,记录一下。时间差天数select'2017-12-10'::date-'2017-12-01'::date;时间差秒数selectextract(epochFROM(now()-(now()-interval'1day')));selecttrunc(extract(epochFROM(now()-(now()-interval'1day')))::numeric);selecttrunc(extract(epochFROM(now()-(now()-interval'1day')))::numeric,1);selectround(extract(epochFROM(now()-(now()-interval'1day')))::numeric);...
继续阅读 >