[thelist] sql query for sum of timediff

Matt Warden mwarden at gmail.com
Fri Jun 2 10:33:59 CDT 2006


On 6/2/06, Tab Alleman <talleman at lumpsum.com> wrote:
> If you do this, do you get any rows?:
>
> select *
> from presence
> where starttime is null OR endtime is null

They would not be included in his result, because he is using between.

Try:

select (now() between '2001-01-01 00:00:00' and '2020-01-01 00:00:00');

and

select (now() between '2001-01-01 00:00:00' and null);

The first returns 1 (true) and the second returns null (false in a
where clause).

-- 
Matt Warden
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list