insert into Info select 'admin36' from Info; --FK插入法
select COUNT(*) from Info;
--not in 实现分页查询
declare @pageSize int set @pageSize= 10;--行数
declare @pageNo int set @pageNo = 1000;--页数
select top(10) * from Info
where id not in (
select top(@pageSize*(@pageNo-1)) id from Info
)
-- 使用大于号 > 实现分页查询
declare @pageSize int set @pageSize= 10; --行数
declare @pageNo int set @pageNo = 1000; --页数
select top(@pageSize) * from Info where id >
(select max(id) from --取前十条数据的最大值
(select top(@pageSize*(@pageNo-1)) id from Info) as empInfo) --查询前十条数据
--使用 row_num between 实现分页查询
select * from
(select ROW_NUMBER() over(order by id) as no,* from Info) as emp
where emp.no between 100 and 110