SQL SERVER分页写法

select top 页行数*
from tMessage
where MessageId not in
(select top (页行数 * (页数-1)) MessageId from tMessage order by  CreateTime DESC)
order by CreateTime DESC

 

按照tMessage表中CreateTime倒序分页

posted @ 2011-11-17 01:20  萧风的风  阅读(154)  评论(0编辑  收藏  举报