2005可用Row_number函数加个行号列作标识

解决方案 »

  1.   

    select Row_number() over(order by studid) as px,studid,studname,courid,courname,yeartermid,courorder from T
      

  2.   


    没看懂,能否解释一下.这个Row_number() over(order by studid) as px是什么意思?
      

  3.   

    视图的主键有四个,studid,courid,yeartermid,courorder都是主键这个视图是怎么建立的?是先建立视图,然后再建立另外一个视图然后增加一列呢?还是在建立本视图的时候可以直接增加一列?
      

  4.   

    哦,对了,我用的是SQL2000,2005极不好用,偶还没学会.