Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Windowing functions vs Non-deterministic ROW-NUMBER()

$
0
0
Since windowing functions make a big deal of the OVER ... ORDER BY clause, how can that be reconciled with the non-deterministic ROW_NUMBER() function, i.e. something like: [code="sql"]SELECT ClientNo, SalesNo, ROW_NUMBER() OVER (ORDER BY ClientNo) AS RowNumFROM SalesORDER BY ClientNo, SalesNo;[/code]where a client might appear more than once because of multiple sales for a client.Is ROW_NUMBER() suddenly going to produce a reproducible ordering for the results set ?

Viewing all articles
Browse latest Browse all 3145

Trending Articles