日期:2014-05-17 浏览次数:20475 次
;with t as
(
select top 5 percent pxid
from tb
order by pxid
union all
select top 5 percent pxid
from tb
order by pxid desc
)
select *
from tb a
where not exists(
select 1
from t
where pxid=a.pxid
)
--SQL2000
select *
from tb
where pxid not in(
select top 5 percent pxid
from tb
order by pxid
union all
select top 5 percent pxid
from tb
order by pxid desc
)