日期:2014-05-19  浏览次数:20389 次

字段排序问题
有一个student表,有chinesecredit,Englishcredit两个字段,现在要对chinesecredit进行生序排序,Englishcredit进行降序排序,怎么办?(用一条SQL语句)

------解决方案--------------------
create table #(col nvarchar(10),col2 nvarchar(10),col3 nvarchar(10))
insert into #
select '1 ', '4 ', 'aa ' union all
select '1 ', '3 ', 'bb ' union all
select '2 ', '2 ', 'cc ' union all
select '3 ', '2 ', 'dd ' union all
select '4 ', '1 ', 'ee '
go
--lz注意col2列的变化
select * from # order by col asc,col2 desc
select * from # order by col asc,col2 asc
------解决方案--------------------
1.請你回答我在上面問你的問題

2.請你提供測試數據

謝謝
------解决方案--------------------
晕。楼主你要的那个效果已经改变了表内容了,不是排序所能做到的。