首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

能否让排序的那一列不显示在查询结果中

2012-11-09 
可不可以让排序的那一列不显示在查询结果中?比如:select id,sum(price),sum(number) as paixu from table

可不可以让排序的那一列不显示在查询结果中?
比如:
select id,sum(price),sum(number) as paixu from table group by id orader by paixu desc
可不可以不让paixu这列显示在结果中?


[解决办法]

SQL code
select id,sum(price) from table group by id orader by sum(number) desc
[解决办法]
SQL code
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

[解决办法]



SQL code
SELECT   id,         Sum(price)FROM     TABLEGROUP BY idORDER BY Sum(NUMBER) DESC 

热点排行