In my last post I showed how SQL Server 2005 and later can use a Segment Spool to implement aggregate window functions and the NTILE
ranking function.
The query optimizer is also smart enough to recognise that some queries are logically equivalent to a window function, even if they are written using different syntax.