日期:2014-05-17 浏览次数:20598 次
select * into #1 from (
select 1 a,'A' b,'aaaaaaaa'c union all
select 2,'B','bbbbbbbb' union all
select 3,'C','cccccccc' union all
select 4,'D','dddddddd' union all
select 5,'E','eeeeeeee' union all
select 6,'F','eeeeeeee' union all
select 7,'G','eeeeeeee'
)Z
select * from #1 where a between 1 and 3 --第一页
select * from #1 where a between 4 and 6 --第二页
select case when b='E' then 1 else 2 end as fo,*
from #1 where a between 1 and 3 --第一页
or b='E'
order by fo,a