select identity(int,1,1) id,view_1.* into #t1 from view_1select * from #t1 where id = round(0.2*@cv_count,0)
楼上的好办法,就是效率低了点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');
into #t1
from view_1select * from #t1
where id = round(0.2*@cv_count,0)