可不可以让排序的那一列不显示在查询结果中?
比如:
select id,sum(price),sum(number) as paixu from table group by id orader by paixu desc
可不可以不让paixu这列显示在结果中?
[解决办法]
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 TABLEGROUP BY idORDER BY Sum(NUMBER) DESC