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

SQL分页

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

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

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

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

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

返回列表

没有更早的文章了...

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

“SQL分页” 的相关文章

重置数据库主键ID

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

SQL查询某字段非空的记录

请问我要得到某个字段不为 null ' ' ' ' ' ',等等,(即:不为空,也不为各种数量的空格)sql语句怎么写?------解决方案-------------------------...

C#连接字符串

 //sqlconnection连接字符串 @"Data Source= .\SQLEXPRESS;AttachDBFilename=C:\..\*.MDF;Integrated  Se...

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

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

Access数据库防下载

create table [notdown]([notdown] oleobject)insert into [notdown](notdown) values (0x3C25)...