Wednesday, 15 February 2012

SQL 101: when storing daily figures...

SQL 101: when storing daily figures in weekly batches, you stash half the data in one table and number all the days from 0 to 7 inclusive. (Yes, an eight day week.) Then you store the other half of each week's data in an almost identical table, but number those days NULL+0-6 inclusive. For added variety, try changing which day 0 refers to mid-dataset.

NULL. It's not just for breakfast any more.