当前位置:首页 >数据库 > 正文内容

SQL分页

大滑稽11年前 (2014-03-23)数据库1399

select * from (select ROW_NUMBER() over(order by id desc) as row,* from Article) t
where t.row between 3 and 33

with temptbl as (
 select ROW_NUMBER() over(order by id desc) as row,* from Article
)
select * from temptbl where row between 55 and 66

select top 10 * from Article where id not in
(
 select top (2-1)10 id from Article order by id desc
)
order by id desc

扫描二维码推送至手机访问。

版权声明:本文由第★一★次发布,如需转载请注明出处。

本文链接:https://wpers.net/post/80.html

返回列表

没有更早的文章了...

下一篇:重置数据库主键ID

“SQL分页” 的相关文章

重置数据库主键ID

ACCESS数据库delete from temp Alter TABLE temp Alter COLUMN ID COUNTER (1, ...

ACCESS和MSSQL-如何随机读取数据库记录

查询语句只要这样写,就可以随机取出记录了SQL="Select top 6 * from Dv_bbs1 where isbest = 1 and layer = 1 order by newID() desc"在AC...

SQL把某张表的数据插入到另一张表里

insert into [SignUser]([user],[pwd],[AddDate]) select [user],[pwd],[AddDate] from [user]...