0
周
我有以下各表SQL Server查詢結果通過
Order
ID OrderDate Quantity Item
1 1 jan 2012 5 A
2 6 jan 2012 10 A
3 9 jan 2012 3 B
4 16 jan 2012 2 C
Order Shipped
ID SuppliedOn Quantity Item OrderId
1 7 Jan 2012 3 A 1
2 9 Jan 2012 2 A 1
3 9 Jan 2012 10 A 2
4 17 jan 2012 3 B 3
我想列出秩序的形成,在周提供
像
Week Total_Order_got Total_Order_Supplied Item
1st week Jan(2 jan 2012) 15 3 A
2nd Week Jan(9 jan 2012) 0 12 A
2nd Week Jan(9 jan 2012) 3 0 B
3rd Week Jan(16 jan 2012) 0 3 B
3rd Week Jan(16 jan 2012) 2 0 C