日期:2014-05-17 浏览次数:20574 次
select *
from
(
select *,
ROW_NUMBER() over(partition by isfree order by id desc) rownum
from tb
)t
where rownum <= 10
select * from
(select top 10 * from [表名] where isfree='true' order by id desc) a
union all
select * from
(select top 10 * from [表名] where isfree='false' order by id desc) b