8AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAYaXc47IOuU6ltmljCrTt9wAAAAAIAAAARABUAFMAAAAQZgAAAAEAACAAAABPd3LmySe6xWtH3rEpALoOA5LPYiT3FkcOxDflpHRo2AAAAAAOgAAAAAIAACAAAAB3/XNUQmEm86rM+R909DMo87V/k5GnfgtV99hykeCdHDAAAABpQ+X3gQwpBdjPYYOXrnOnL/dac0YYFtr5GqrDjFjeQ43rCPdEXYLL5CVZ2SfcLO5AAAAA1bK5aB10JXLy4AWlTWCVJ+kYgUErv6DiXSbf5QJYRwx5Osb0Xjl828ElN7+6W6XyIbpyUMO4snP0agEvo5+Zhw0with 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 desc936false20[dbo].[BaseETL_90P_Weight]936false3falsefalseCHECK_CONSTRAINTS21474836470with 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 desc936false20[dbo].[BaseETL_95P_Weight]936false3falsefalseTABLOCK,CHECK_CONSTRAINTS2147483647DataSourceViewIDTableInfoObjectTypeTableDataSourceViewIDTableInfoObjectTypeTableDataSourceViewIDDataSourceViewID]]>