Solved

What is the SQL to select first 100 records?

Posted on 2011-09-13
2
467 Views
Last Modified: 2012-05-12
What is the SQL to select first 100 records?

Currently I am using SELECT TOP 100 but this gives me records that have the same value in the descending field

Thanks
0
Comment
Question by:kosenrufu
2 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36530413
post a copy of the db and explain, which records you want to see using a select top 100 query..
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 36530446
When you use a single field in your Group BY clause, and then indicate Select Top 100, you will get the top 100, plus any additional records where the value in the field you are grouping by is the same as for the 100th record.

To alleviate this, you should add another field to the group by clause.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question