嗨,我有以下选择语句
select
a.amount
,b.des
,a.id
,SUM(a.amount) as total
,b.id
from t_sales a
left outer join t_location b on(b.id=a.orgId)
where a.Id=@salesId and
a.sId=@supId
GROUP BY a.amount, b.des, a.Id,b.id;
一切都很好,除了总数。我正在尝试获取 a.amount 的总数,它返回 15 个值,所以我想拥有所有 15 个值的总数。请让我知道如何解决它。谢谢