我在使用OFFSET(在linq中使用skip)时遇到了一个奇怪的问题。当我使用where子句过滤空值时,offset返回的记录顺序错误。
select * from ExpectedApplication where ApplicationId is null
order by PaymentDate desc
OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY
select * from ExpectedApplication where ApplicationId is null
order by PaymentDate desc
OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY
输出结果是:
由于这个问题,我的分页结果返回了不正确的数据。请帮忙解决。非常感谢。
祝好, Vivek
select PaymentDate,* from ExpectedApplication where ApplicationId is null order by PaymentDate desc OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY
- Lukasz Szozda