sql - How to include null datetime in between clause in mysql -
i tried select data between devicetime='2017-04-06 10:06:57' , devicetime='2017-04-06 10:07:05' result doesn't include devicetime null value.
select * positions devicetime between '2017-04-06 10:06:57' , '2017-04-06 10:07:05' , deviceid=2
i tried query above doesn't work.
first, should careful using between
datetime
values. often, want strict less on upper value.
in case, looking basic logic:
select p.* positions p (device time null or devicetime between '2017-04-06 10:06:57' , '2017-04-06 10:07:05' ) , deviceid = 2;
Comments
Post a Comment