8 AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAYaXc47IOuU6ltmljCrTt9wAAAAAIAAAARABUAFMAAAAQZgAAAAEAACAAAABPd3LmySe6xWtH3rEpALoOA5LPYiT3FkcOxDflpHRo2AAAAAAOgAAAAAIAACAAAAB3/XNUQmEm86rM+R909DMo87V/k5GnfgtV99hykeCdHDAAAABpQ+X3gQwpBdjPYYOXrnOnL/dac0YYFtr5GqrDjFjeQ43rCPdEXYLL5CVZ2SfcLO5AAAAA1bK5aB10JXLy4AWlTWCVJ+kYgUErv6DiXSbf5QJYRwx5Osb0Xjl828ElN7+6W6XyIbpyUMO4snP0agEvo5+Zhw 0 with t1 as( select PERCENT_RANK() over ( partition by convert(nvarchar(10),ReceiveTime,120),case when h.name ='美国快线YSW' then '美国快线' else h.name end order by datediff(HOUR,e.ReceiveTime,isnull(d.signtime,'9999-01-01'))/24.0) pr ,datediff(HOUR,e.ReceiveTime,d.signtime)/24.0 as r, convert(nvarchar(10),ReceiveTime,120) ReceiveTimeStr,d.TrackingNumber,case when h.name ='美国快线YSW' then '美国快线' else h.name end name from Order_Order(nolock)e join Logistics_Trace(nolock)d on d.OrderId=e.Id join Logistics_Channel(nolock) f on f.id=e.ChannelId join Logistics_Channel(nolock)g on g.id=e.CreateOrderChannelId join Logistics_Public(nolock)h on h.Code=g.PublicCode where e.CreateTime>'2022-05-01' ) select ReceiveTimeStr,Name,MIN(r)time from t1 where pr>=0.90 group by ReceiveTimeStr,Name order by ReceiveTimeStr desc 936 false 2 0 [dbo].[BaseETL_90P_Weight] 936 false 3 false false CHECK_CONSTRAINTS 2147483647 0 with t1 as( select PERCENT_RANK() over ( partition by convert(nvarchar(10),ReceiveTime,120),case when h.name ='美国快线YSW' then '美国快线' else h.name end order by datediff(HOUR,e.ReceiveTime,isnull(d.signtime,'9999-01-01'))/24.0) pr ,datediff(HOUR,e.ReceiveTime,d.signtime)/24.0 as r, convert(nvarchar(10),ReceiveTime,120) ReceiveTimeStr,d.TrackingNumber,case when h.name ='美国快线YSW' then '美国快线' else h.name end name from Order_Order(nolock)e join Logistics_Trace(nolock)d on d.OrderId=e.Id join Logistics_Channel(nolock) f on f.id=e.ChannelId join Logistics_Channel(nolock)g on g.id=e.CreateOrderChannelId join Logistics_Public(nolock)h on h.Code=g.PublicCode where e.CreateTime>'2022-05-01' ) select ReceiveTimeStr,Name,MIN(r)time from t1 where pr>=0.90 group by ReceiveTimeStr,Name order by ReceiveTimeStr desc 936 false 2 0 [dbo].[BaseETL_95P_Weight] 936 false 3 false false TABLOCK,CHECK_CONSTRAINTS 2147483647 DataSourceViewID TableInfoObjectType Table DataSourceViewID TableInfoObjectType Table DataSourceViewID DataSourceViewID ]]>