example1: app
-- 判斷兩個時間差大於4個小時 select
select timestamp '2013-11-11 10:00:00' - timestamp '2013-11-08 12:00:00' > interval '4 hour'; im
example2: 時間
-- 獲取時間差的整體小時差 而後再判斷 time
mrapp=> select extract(day from t) * 24 + extract(hour from t) > 4 from (select (timestamp '2013-12-14 12:00:00' - timestamp '2013-12-11 4:00:00') as t) as a;
其餘的都比較麻煩了 暫不列