尝试创建一个报告,在该报告中我比较两个时间戳并获得小时:分钟的时差,但不包括周末。
例如:
(select CONCAT((extract(hours from cad.pre_draw_complete - cad.pre_draw_start) + extract(days from cad.pre_draw_complete - cad.pre_draw_start) * 24::text, ':', extract(mins from cad.pre_draw_complete - cad.pre_draw_start)::text)) as "Predraw duration"
这将返回时差与小时:分钟。比较周末时如何过滤周末?我正在使用Postgres 9.1