pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: holm@freibergnet.de
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Problem with datetime
Date: Fri, 29 Oct 1999 09:44:55 -0400
Message-ID: <1895.941204695@sss.pgh.pa.us> (raw)
In-Reply-To: <19991029101430.B65318@pegasus.freibergnet.de>

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



view thread (2+ messages)

Message-ID: <1895.941204695@sss.pgh.pa.us>
Permalink:  ../1895.941204695@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1895.941204695@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, holm@freibergnet.de
  Subject: Re: [SQL] Problem with datetime
  In-Reply-To: <1895.941204695@sss.pgh.pa.us>
  References: <19991029101430.B65318@pegasus.freibergnet.de> <1895.941204695@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox