July 26, 2017 at 9:42 pm
Comments posted to this topic are about the item The Strange First Value
July 27, 2017 at 1:58 am
I'd prefer to useFIRST_VALUE(pts) OVER (Partition by Team ORDER BY Year ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
since this performs better (does not spill to tempdb as it does with the default RANGE BETWEEN...).
God is real, unless declared integer.
July 27, 2017 at 3:56 am
t.franz - Thursday, July 27, 2017 1:58 AMI'd prefer to useFIRST_VALUE(pts) OVER (Partition by Team ORDER BY Year ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
since this performs better (does not spill to tempdb as it does with the default RANGE BETWEEN...).
Agreed
Nice question, though, thanks Steve
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
July 28, 2017 at 4:14 pm
Nice simple question.
But the "wrong" output without the partition has a missing row - that query would return 11 rows, not 10, just as for tge output when teh qquery is corrected.
Tom
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply