create table student(id identity(1,1),编号 varchar(2),成绩 int) insert into student(编号,成绩) values('A' ,89) insert into student(编号,成绩) values('B' ,90) insert into student(编号,成绩) values('C' ,70) insert into student(编号,成绩) values('D' ,87)select * from student order by 成绩 desc
select [序号]=identity(int,1,1),a.* into #New from (select * from 学生成绩表 order by 成绩 desc)a
select 序号=identity(int,1,1),tb1.* into ntb from (select * from tb order by 成绩 desc)tb1
insert into student(编号,成绩) values('A' ,89)
insert into student(编号,成绩) values('B' ,90)
insert into student(编号,成绩) values('C' ,70)
insert into student(编号,成绩) values('D' ,87)select *
from student
order by 成绩 desc
from (select * from 学生成绩表 order by 成绩 desc)a
select 序号=identity(int,1,1),tb1.* into ntb from (select * from tb order by 成绩 desc)tb1