注册 登录
编程论坛 SQL Server论坛

怎样得到排序中的名次?

ask001 发布于 2008-01-01 13:55, 1310 次点击
比如在排序中是第一名,则得到1
在排序中是第二,就得到2.

以此类推、
3 回复
#2
XieLi2008-01-03 08:59
给他一个自动增长例
#3
purana2008-01-03 15:43
使用子查询.
#4
西风独自凉2008-01-03 20:03
select *,identity(int,1, 1) as seqid  into t_aa    from t_test order by id

select *from t_aa

drop table t_aa
1