问个问题 你们遇到过没有
select top 20* from ExchangeView where 1=1 and EID not in (select top 10 EID from ExchangeView where 1=1)括号外边的数据id 不是 顺序的 举例 123 456 678 90 34 5 234 354 6467
但是括号里边的EID 是固定 1 2 3 4 5 6 7 8 9 10
这就导致了 无法分页 id 对不上号
怎么改变外边的这个数据顺序
我试过 +2个order by
s
select top 10 * from ExchangeView where 1=1 and EID not in (select top 20 EID from ExchangeView where 1=1 order by EID asc) order by EID asc
但是括号外边的eid 仍然是 123 456 678 90 34 5 234 354 6467 外边内个order by 最后uizhejige随机数字 排序了
select top 20* from ExchangeView where 1=1 and EID not in (select top 10 EID from ExchangeView where 1=1)括号外边的数据id 不是 顺序的 举例 123 456 678 90 34 5 234 354 6467
但是括号里边的EID 是固定 1 2 3 4 5 6 7 8 9 10
这就导致了 无法分页 id 对不上号
怎么改变外边的这个数据顺序
我试过 +2个order by
s
select top 10 * from ExchangeView where 1=1 and EID not in (select top 20 EID from ExchangeView where 1=1 order by EID asc) order by EID asc
但是括号外边的eid 仍然是 123 456 678 90 34 5 234 354 6467 外边内个order by 最后uizhejige随机数字 排序了
你这个分页是需要两个order by的
这个试试