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

    技术2025-07-22  12

    在SQL Server2000中实现rowNumber功能:查询中生成自动增长列,以下是示例代码:

     

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

     

    其中,tb_product 是表名,proid是主键且是自动增长。

    最新回复(0)