SQL SELECT TOP Statement

  • The SELECT TOP statement returns a specified number of records.
  • SELECT TOP is useful when working with very large datasets.
  • Non SQL Server databases use keywords like LIMIT, OFFSET, and ROWNUM.
The definitive guide
for data professionals


Order today!
 See 2 min video



The SQL SELECT TOP syntax


The general syntax is:
SELECT TOP n column-names
  FROM table-name




SQL SELECT TOP




Problem: List top 10 most expensive products
SELECT TOP 10 Id, ProductName, UnitPrice, Package
  FROM Product
 ORDER BY UnitPrice DESC


Results: 10 records.

Id ProductName UnitPrice Package
38 Côte de Blaye 263.50 12 - 75 cl bottles
29 Thüringer Rostbratwurst 123.79 50 bags x 30 sausgs.
9 Mishi Kobe Niku 97.00 18 - 500 g pkgs.
20 Sir Rodney's Marmalade 81.00 30 gift boxes
18 Carnarvon Tigers 62.50 16 kg pkg.
59 Raclette Courdavault 55.00 5 kg pkg.
51 Manjimup Dried Apples 53.00 50 - 300 g pkgs.
62 Tarte au sucre 49.30 48 pies
43 Ipoh Coffee 46.00 16 - 500 g tins
28 Rössle Sauerkraut 45.60 25 - 825 g cans