比如获取每个表的前10%个字段。
<div class=”codetitle”><a style=”CURSOR: pointer” data=”9489″ class=”copybut” id=”copybut9489″ onclick=”doCopy(‘code9489’)”> 代码如下:<div class=”codebody” id=”code9489″>
select id,name,colid,rn from (
select *,rn = ntile (10 )
over (partition by id order by colorder )
from syscolumns )t where rn = 1