您的位置:首页 > 数据库

在SQL Server2000中实现rowNumber功能:查询中生成自动增长列

2011-02-13 23:35 567 查看
在SQL Server2000中实现rowNumber功能:查询中生成自动增长列,以下是示例代码:

select ( select count(*)
from tb_product p1
where p1.proid <= p2.proid) as rowNumber,
* from tb_product p2
order by rowNumber

其中,tb_product 是表名,proid是主键且是自动增长。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: