-- 对比 数据 是否 相同
select * from [dbo].[ProjecrInfo] where Project_state='已审核' -- 查询 已经 审核 有多少数据
-- 每次 按照 6行查询 第一个 6 是 每次 显示 6行数 据 可以改 成 你想 每次按照 几行查询 第二个 数字是 分页
select top 6 * from ProjecrInfo where ProjectID not in
(select top 12 ProjectID from ProjecrInfo where Project_state ='已审核' order by ProjectID ) and Project_state ='已审核' order by ProjectID
--------------2019年4月1日18:21:22 更新-----
-------------------分页
select top 20 suser_id,suser_unit,ssys_name from [mdc_drug_match_result]
对比
select top 10 * from [mdc_drug_match_result] -- 10 是rows where suser_id not in(select top ((1-1)*10) suser_id --((page-1)*rows) page 第几页 rows 一页显示多少 from [mdc_drug_match_result])
--page rows select top 20 suser_id,suser_unit,ssys_name from [mdc_drug_match_result] -------------------分页 select top 10 * from [mdc_drug_match_result] -- 10 是rows where suser_id not in(select top ((2-1)*10) suser_id --((page-1)*rows) page 第几页 rows 一页显示多少 from [mdc_drug_match_result])
select * from( select Row_Number() OVER(ORDER BY Id) AS rowNum,* from ControlBoxInfo 多表链接, +条件 ) t where t.rowNum > ((page-1)*rows) and t.rowNum < (page*rows)
--------End-------