مشابه همین اگر بخواهیم نامبرینگ رو براساس supplier انجام بدیم:
SELECT
A.ProductID,
A.ProductName,
A.SupplierID,
(
SELECT COUNT(ProductID)
FROM Products AS B
WHERE B.SupplierID = A.SupplierID
AND
B.ProductID <= A.ProductID
) AS [Row Number]
FROM Products AS A
ORDER BY A.SupplierID, A.ProductID;
2.png





پاسخ با نقل قول