Free for PREMIUM members
Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium
SELECT CustomerID, OrderID, RankOrder
SELECT CustomerID, OrderID,
RANK() OVER (PARTITION BY CustomerID ORDER BY OrderDate DESC) as RankOrder
FROM SalesOrderTable) a
WHERE RankOrder <= 2
Open in new window
We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!