SQL group by day, show orders for each day

后端 未结 6 1584
梦毁少年i
梦毁少年i 2020-12-15 22:44

I have an SQL 2005 table, let\'s call it Orders, in the format:

OrderID, OrderDate,  OrderAmount
1,       25/11/2008, 10
2,       25/11/2008, 2
3,       30/1         


        
6条回答
  •  我在风中等你
    2020-12-15 23:26

    Since you will want to use this date table frequently in other queries as well, I suggest you make it a permanent table and create a job to add the new year's dates once a year.

提交回复
热议问题