« first day (2070 days earlier)      last day (2804 days later) » 

10:21 AM
morning
 
10:46 AM
Does OPTION(RECOMPILE) is only for SP's ?
what about inline quries ?
 
@RoyiNamir I think it's part of a query
 
 
6 hours later…
4:43 PM
@MartinSmith nice idea, why did you delete the answer?
I mean about the random GroupID sorting
You could use FIRST_VALUE(<random_function>) OVER (PARTITION BY GroupID ORDER BY SomeValue) to remove the group size effect
Or the ROW()_NUMBER() .. = 1 you already posted. Seems better and works in older versions.
 
5:06 PM
@ypercubeᵀᴹ Good idea. I'll "borrow" that!
 

« first day (2070 days earlier)      last day (2804 days later) »