现在的位置: 首页 > 综合 > 正文

一条SQL语句实现数据库分页

2013年04月24日 ⁄ 综合 ⁄ 共 212字 ⁄ 字号 评论关闭
一种:
select * from (
select top 20 * from(
select top 80 * from(

select a.* from business.dbo.tb_cocacola_mms as a 
where a.checkTag=1

)
as x order by x.updateTime desc)
as y order by y.updateTime asc)
as z order by z.updateTime desc

其中desc,asc之类的可以根据实际情况

抱歉!评论已关闭.