Hi I am creating a table like the below in SQL but am struggling with producing the last column
I have tried using distinct & partitions but not cracked it yet...
,SUM(PT.[Days to Deliver]) over(partition by PT.[Order Number]) **(invalid for sum operator)
,SUM(distinct(PT.[Order Number]) PT.[Days to Deliver] - just getting in a muddle so some help would be fab