SQL Server数据库用sql语句实现分页查询 (从M条数据开始,查找N条记录。sqlserver数据库。请举例说明。)

如题所述

1:新建一个数据库
create
database
数据库名
2:新建一个表
create
table
表名
(
字段名
类型
是否为空
)
3:删除一个表
drop
table
表名
4:增加一个记录
insert
表名
[(字段)]
values
(
内容
)
5:删除一个记录
delete
[from]
表名
where
条件
6、修改一个记录
update
表名
set
字段名=更新内容
where
条件
7、在原表中增加一个字段
alter
table
表名
add
column
字段名
类型
8:在原表中删除一个字段
alter
table
表名
drop
column
字段名
9、查询一个表记录
select
*
from
表名
10、带条件查询一个表记录
select
*
from
表名
where
=条件
温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-07-30
你好!
假设table1以id列排序。
select
top
N*
from
(select
top
(M+N)
*
from
table1
order
by
id)t
order
by
id
desc
希望对你有所帮助,望采纳。
相似回答