• cengland0 (1/6/2011)


    Another way to put this is if the question said:

    In a non-empty rowset, ROW_NUMBER() always returns consecutive integers.

    What would you answer? True or False?

    I'd still answer False because it's possible to have a one-row rowset but the author is probably thinking True.

    I guess I'd first check to see if you are the author of that question 😉

    But had I seen such a question before today, then I think there's about 80% chance I'd have replied True.

    If the correct answer had been False because of PARTITION BY, I would have slapped myself on the forehead and complimented the question's author.

    If the correct answer had been False because of a single-row rowset "not being consecutive", I would have felt misled and cheated.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/