请问sql2000,在视图里如何加一列自增列?
rt
------解决方案--------------------
SQL code
select id=identity(int,1,1) ,* into #t from tb
------解决方案--------------------
------解决方案--------------------
--sql 2000
select t.* , px = (select count(1) from tb where col < t.col) + 1 from tb t
--sql 2005
select t.* , px = row_number() over(order by col) from tb t
------解决方案--------------------