a) Quote is taken from http://www.postgresql.org/docs/current/static/tutorial-window.html
for each row, there is a set of rows within its partition called its window frame. Many (but not all) window functions act only on the rows of the window frame, rather than of the whole partition. By default, if ORDER BY is supplied then the frame consists of all rows from the start of the partition up through the current row, plus any following rows that are equal to the current row according to the ORDER BY clause
I assume Row_Number doesn’t act only on rows of the window frame, but instead always act on all rows of a partition?
b)
By default, if ORDER BY is supplied then the frame consists of all rows from the start of the partition up through the current row, plus any following rows that are equal to the current row according to the ORDER BY clause
I assume that is only true for those window functions that act only on rows of the window frame ( thus above quote isn’t true for ROW_NUMBER() function )?
c) http://www.postgresql.org/docs/current/static/tutorial-window.html talks about PostgreSQL 8.4’s Windowing functions. Is everything in that article also true for Sql Server 2008’s Windowing functions
thanx
The ORDER BY clause in aggregate window functions is not supported by SQL Server yet.
http://msdn.microsoft.com/en-us/library/ms189461.aspx
The below query will give you a syntax error
row_number()is not an aggregate window function so it does not act on rows of the window frame only. It acts on the whole partition. Only aggregate functions work on the window frame. And only if the ORDER BY clause is supported.