I need to be able to show the items that has the top 10 highest values (quantity*price).
In MySQL you can use LIMIT, but that’s not possible in SQL Server. How can I achieve my goal?
Thanks in advance
SELECT ItemID, Itemname, Quantity, Price,
CONVERT(Decimal(8,0),ROUND((Quantity*price),2)) AS Total
FROM Item
The
ORDER BY Quantity * Price DESCwill ensure that the highest values are returned first.