A表 User字段IDName
B表Orders 字段OrderPriceUserID
两个表查询 如何获得所有A表订单的总金额,并且排序?
select *,sum(OrderPrice) as total from Orders join User on Orders.Userid = User.ID group by Name (不是很理解什么叫 "A表订单的总金额") order by total desc