日期:2014-05-17 浏览次数:20484 次
select id,sum(price) from table group by id orader by sum(number) desc
------解决方案--------------------
select id,sum(price) from table group by id orader by sum(number) desc
------解决方案--------------------
[code=SQL][/code]
select id,sum(price),sum(number),row_number() over(order by sum(number) desc)as paixu from table group by id order by sum(number) desc
------解决方案--------------------
SELECT id, Sum(price) FROM TABLE GROUP BY id ORDER BY Sum(NUMBER) DESC