All pastes #370289 Raw Edit

Gopneg

public text v1 · immutable
#370289 ·published 2007-02-24 13:02 UTC
rendered paste body
select count(t2.date) cnt, t2.date
  from 
    (select distinct p.date + t.time_out date
    from pass_in_trip p, trip t where p.trip_no = t.trip_no) t1,
    (select distinct p.date + t.time_out date
    from pass_in_trip p, trip t where p.trip_no = t.trip_no) t2
  where t1.date >= t2.date   
  group by t2.date