是否可以在不返回多行(Group BY)的情况下获得总数?
例子:
数据:
ID Amount Quantity
1 50 1
2 50 2
select sum(Amount) * Quantity, SUM(Quantity) as totalQuantity
from tbl
我希望结果在 1 行:
total totalQuantity
150 3
是否可以在不返回多行(Group BY)的情况下获得总数?
例子:
数据:
ID Amount Quantity
1 50 1
2 50 2
select sum(Amount) * Quantity, SUM(Quantity) as totalQuantity
from tbl
我希望结果在 1 行:
total totalQuantity
150 3