原文:
摘要:
order by 1,2 的含义是对表的第一列 按照从小到大的顺序进行排列然后再对第二列按照从小到大的顺序进行排列
order by 1,2 等同于 order by [第一列],[第二列]
详见以下举例说明
create table A (keyId varchar(20),name varchar(120))goinsert into A (name,keyId)values(10,'we')insert into A (name,keyId)values(2,'b')insert into A (name,keyId)values(3,'C')insert into A (name,keyId)values(4,'a')insert into A (name,keyId)values(5,'E')insert into A (name,keyId)values(7,'F')goselect * from A goselect * from A order by 1,2 gotruncate table Adrop table A go
posted on 2018-07-17 00:29 阅读( ...) 评论( ...)