[步骤]
SQL 传入的是 SKU ,返回也是SKU
select distinct ol.SKU from RB_OrderInfo info (nolock) inner join RB_OrderInfo_BeikuExpand infob (nolock) on info.CustomerID=infob.CustomerID and info.OrderCode=infob.OrderCode inner join RB_OrderList ol (nolock) on info.CustomerID=ol.CustomerID and info.OrderCode=ol.OrderCode WHERE info.CustomerID in (1) and info.IsStockOrder=1 and infob.RestockType=2 and info.AddTime>=DATEADD(year,-2,getdate()) and ol.sku in ('3206874')
改成
select top 1 ol.SKU from RB_OrderInfo info (nolock) inner join RB_OrderInfo_BeikuExpand infob (nolock) on info.CustomerID=infob.CustomerID and info.OrderCode=infob.OrderCode inner join RB_OrderList ol (nolock) on info.CustomerID=ol.CustomerID and info.OrderCode=ol.OrderCode WHERE info.CustomerID in (1) and info.IsStockOrder=1 and infob.RestockType=2 and info.AddTime>=DATEADD(year,-2,getdate()) and ol.sku in ('3206874')

[结果]
[期望]
按要求修改 提成性能几十倍,缓和性能压力


