ROW NUMBER() OVER

前端 未结 2 1519
迷失自我
迷失自我 2021-01-17 17:27

I came across a somewhat special syntax, could you help in figuring out what it means? Thank you.

SELECT ROW NUMBER() OVER (ORDER BY Product.ProductID) FROM          


        
2条回答
  •  醉梦人生
    2021-01-17 17:40

    The ROW_NUMBER() function requires the OVER(ORDER BY) expression to determine the order that the rows are numbered. The default order is ascending but descending can also be used. This function is useful for a variety of things like keeping track of rows when iterating through a set of records since T-SQL does not allow a cursor to be retrieved outside of T-SQL. @tunimise fasipe is correct, you are missing the _

提交回复
热议问题