的具体含义

2019-10-11 21:23栏目:计算机论坛
TAG:

转自:http://www.maomao365.com/?p=5416

 

摘要:
order by 1,2 的含义是对表的第一列  按照从小到大的顺序进行排列

 然后再对第二列按照从小到大的顺序进行排列

  order by 1,2 等同于 order by [第一列],[第二列] 

 详见以下举例说明  

 

 

create table A (keyId varchar(20),name varchar(120))
go
insert 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')
go
select * from A 
go
select * from A order by  1,2 
go
truncate table A
drop table A 
go 

 

版权声明:本文由493333王中王开奖结果发布于计算机论坛,转载请注明出处:的具体含义

    随机看看

    NEW ARTICLE

    热门文章

    HOT ARTICLE