听上去很简单啊。
select product_id, sum(sale_qty) as ttl_qty
from sales
group by product_id
select product_id, sum(sale_qty) as ttl_qty
from sales
group by product_id
解决方案 »
- 求助 Login failed for user 'sa'
- 关于保存订单的表结构
- 请帮我看看SET @cmd = 'EXEC sp_by_id' + ' ' + convert(nvarchar(50),@bID) + ',' + @ret + ' output'
- 求一SQL语句 或函数!!
- 求助触发器的编写
- OPENROWSET报错,紧急求救!
- sql 的表格里面显示日期的格式为: 2002-2-2
- 调用存储过程?
- 怎样在SQLServer中建立类似于Oracle中的DBLink?
- 当我对adoquery1 post 时,出现错误:Row cannot be located for updating。Some values may have been changed since it was last read.
- 关于SQL Server 2000中的问题
- tiemstamp 是什么时间格式该如何使用where查询
也可以用VFP的 sum .... for
count ... for