Home  |   French  |   About  |   Search  | mvps.org  

What's New
Table Of Contents
Credits
Netiquette
10 Commandments 
Bugs
Tables
Queries
Forms
Reports
Modules
APIs
Strings
Date/Time
General
Downloads
Resources
Search
Feedback
mvps.org

In Memoriam

Terms of Use


VB Petition

Queries: Create a query that returns Top n records

Author(s)
Dev Ashish
(Q)    How do I create query that returns the top 5 records based on ProductUnitPrice in my table?

(A)    Use the following SQL as an example.

SELECT Top 5 ProductName, ProductUnitPrice
FROM Products
GROUP BY ProductName, ProductUnitPrice
ORDER BY ProductUnitPrice Desc;

© 1998-2010, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer