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.

enter image description here

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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -