[步骤]
单次 都超1分钟请求 分组排序 去重 极大消耗系统临时表空间
from
RB_OrderInfo o ( NOLOCK )
JOIN RB_OrderSource sc ( NOLOCK ) ON o.OrderSourceID = sc.ID
AND sc.OrderSourceType= 1
LEFT JOIN RB_OrderInfo_BeikuExpand beikuExpand ( NOLOCK ) ON beikuExpand.CustomerID = o.CustomerID
AND o.OrderCode = beikuExpand.OrderCode
WHERE
o.CustomerID = 1
AND o.IsStockOrder = 1
AND beikuExpand.OrderBuildType IN ( 1, 2 )
AND ISNULL(o.AmazonShipmentId,'')=''
AND (o.OrderStatus =1 or ( o.OrderStatus =0 and o.OrderState=0 ) or (o.OrderStatus in(2,3) and o.UpdateTime >= DATEADD(Hour, -10, GETDATE())))
AND sc.OrderSourceType = 1
ORDER BY o.OrderCode
OFFSET 2000 ROWS
FETCH NEXT 1000 ROWS ONLY;

[结果]
[期望]
订单同步数据 不要添加逻辑
