sql - sqlite Select specific day of specific month and none specific month -
what trying select specific month , specific day timestamp. have tried this:
select t test t between '2015-08-01 00:00:00' , '2015-08-01 23:59:59';
with 8 being specifc month , 1 being specific day doesn't return anything.
another thing choose specific day of every month of year have tried know wrong not sure how else is:
select t test t between '2015-01-12 00:00:00' , '2015-24-12 23:59:59';
i can see why wouldn't work take every timestamp day in first month same day in last month, how can it?
edit: found why wasn't working first example variable had day contained number when lower 10 said # , not 0#
you use like
clause this. between won't work edge cases if have milliseconds after :59.
where t '2015-08-01 %'
and:
where t '2015-%-12 %'
also, regarding optimization, timestamp
or similar has text affinity (even though docs seem allude being numeric). should allow like optimization
if have index, using ranges better if can manage it. check query plans.
Comments
Post a Comment