rt

解决方案 »

  1.   

    select id=identity(int,1,1) ,* into #t from tb
      

  2.   

    --sql 2000select t.* , px = (select count(1) from tb where col < t.col) + 1 from tb t--sql 2005select t.* , px = row_number() over(order by col) from tb t
      

  3.   

    rt dawugui
    用表里有会出现重复
    aa      px
    .00 1
    500.00 2
    30.00 3
    1200.00 4
    1200.00 4
    1200.00 4
    1200.00 4
      

  4.   

    这是两码事吧,用row_number就行了,如果是2005以上版本的话