I'm trying to get some data from my tables - I need only a particular time of day ( between 22:00 PM one night and 06:00 AM the next morning) over a fixed date range.
This is what I have so far:
create new_table
as select table.v1, table.localminute from table
where date(table.localminute) between
date('2013-11-01 00:00:00-05') and date('2014-12-01 00:00:00-05')
and hour(table.localminute) between 22 and 6
I'm not sure how to just get the data for between the hours of 22:00:00-05 and 06:00:00-05 each day.
I also thought about using wildcards for the dates but either it doesn't work or my implementation wasn't right. Any help will be appreciated!
I used info from the link below to set this up as it is - not sure what I need to do.