我如何获得本周与去年同一周的总销售额?
与如何存储日期有关的可能方案有两种,如下所示:
方案 1
**Sales**
Date Sales
-----------------------
2012-08-10 11040.00
2012-08-09 11500.00
2012-08-08 14060.00
2012-08-07 93000.00
2012-08-06 11200.00
...
2011-08-10 11040.00
2011-08-09 11500.00
2011-08-08 14060.00
2011-08-07 93000.00
2011-08-06 11200.00
方案 2
**Sales**
year month day Sales
---------------------------------------------
2012 08 10 11040.00
2012 08 09 11500.00
2012 08 08 14060.00
2012 08 07 23000.00
2012 08 06 11200.00
...
2011 08 10 13040.00
2011 08 09 11500.00
2011 08 08 12060.00
2011 08 07 33000.00
2011 08 06 11250.00