在SQLSERVER2000下实现结果集显示行号

在SQLSERVER2000下实现结果集显示行号

select rowid=(select count(*) from PE_U_GoodArticle where ID<=a.ID),* from TABLE a

如果要根据行号取对应行的数据以下语句可以实现

select * from (select rowid=(select count(*) from PE_U_GoodArticle where ID<=a.ID),* from PE_U_GoodArticle a) b where b.rowid=5

posted @ 2008-09-12 11:09  supers  阅读(705)  评论(0)    收藏  举报