视图中的数据是经过排序后的数据.
假如行数为  @cv_count=100
如何得到   第    round(0.2*@cv_count,0) 行 这一单行的数据.

解决方案 »

  1.   

    select identity(int,1,1) id,view_1.*
    into #t1
    from view_1select * from #t1
    where id = round(0.2*@cv_count,0)
      

  2.   

    楼上的好办法,就是效率低了点exec('select top 1 * from (select top '+cast((1 + round(0.2*@cv_count,0)) as varchar(20)) +' * from view_1 order by id asc)a order by id desc');