表:
x_ID x_sale x_date
A 200 2009-12-01
B 300 2009-12-01
A 100 2009-12-02
C 70 2009-12-02
B 50 2009-12-03
A 150 2009-12-03
要求查询01号到03号A的总x_sale,B的总x_sale,C的总x_sale,还有01号到03号所有的总和,正确的sql要怎么写,
我现在用group by 求出分开的总数,但所有的总数老是出错,
Select TABLE1.x_ID,SUM(TABLE1.x_sale) AS sumsalein FROM WHERE (TABLE1.x_date BETWEEN '"&2009-12-01
&"' AND '"&2009-12-03&"') GROUP BY TABLE1.x_ID,
这样可以求出A的总x_sale,B的总x_sale,C的总x_sale,但是还是一个总数SUM(A+B+C)要怎么体现出来,怎么写呢??