我有一个类似于以下的表
Date | qty1 | qty2 | qty3 | qty4 | column6
1 july | 33 | 0 | 0 | 0 | xyz
1 July | 0 | 20 | 0 | 0 | xyz
1 July | 18 | 0 | 0 | 0 | abc
3 July | 0 | 0 | 0 | 11 | abc
3 july | 23 | 0 | 0 | 0 | xyz
4 July | 0 | 40 | 0 | 0 | xyz
4 July | 57 | 0 | 0 | 0 | abc
7 July | 0 | 12 | 0 | 0 | xyz
我正在 sql server 2005 的存储过程中寻找如下输出。
Date | qty1 | qty2 | qty3 | qty4
1 July | 51 | 20 | 0 | 0
2 July | 0 | 0 | 0 | 0
3 July | 23 | 0 | 0 | 11
4 July | 57 | 40 | 0 | 0
5 July | 0 | 0 | 0 | 0
6 July | 0 | 0 | 0 | 0
7 July | 0 | 12 | 0 | 0
正如您所注意到的,我希望它自动为缺失日期输入 0 值。我想知道这是否可能。