Re: storing start/end times
Posted by: Peter Brawley
Date: April 08, 2015 11:04AM

> you said...yearly calendar...does that mean having 365 columns?

Good grief.

You didn't read "Make a calendar table" at http://www.artfulsoftware.com/queries.php, did you?

One column, 365 rows per year, 366 on leap year, for as many years as the database tracks. Then, to find open/close times for store 27 in May 2015, write ...

select c.date, s.open, s.close
from calendar c
join storesopen s on c.date=s.date and s.sid=27
where left(c.date, 7) = '2015-05';

Options: ReplyQuote


Subject
Written By
Posted
Re: storing start/end times
April 08, 2015 11:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.