Holm Tiffe <holm@freibergnet.de> writes:
> But now both days at on time:
> SELECT sum(stop-start) FROM logs WHERE name = 'intern-mw' and
start> = '27-10-1999' AND stop < ('28-10-1999'::datetime + '1 day'::timespan);
> sum
> -------------------------
> @ 12 hours 51 mins 4 secs
> (1 row)
> uups what's happening here ?
> I've doublechecked the WHERE clause, It is ok, the right tuples are selected,
> but 3h + 4.5h are not 13h! Wat I'm doing wrong here ?
Maybe I'm missing something obvious, but it seems to me that the above
command will include log entries that cross the midnight boundary
between the two dates, whereas neither of the other two do. Seems like
you must have about 5.5h worth of such entries...
regards, tom lane