Row Number e PARTITION BY SQL

20 de junho de 2020   |   by administrador
SELECT ROW_NUMBER() OVER(
       PARTITION BY CustomerID
       ORDER BY CustomerID) AS RowNum, 
       CustomerID, 
       SalesOrderID, 
       OrderDate, 
       SalesOrderNumber, 
       SubTotal, 
       TotalDue
FROM Sales.SalesOrderHeader;

Tags: