[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 538
  • Last Modified:

What is the SQL to select first 100 records?

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
kosenrufu
Asked:
kosenrufu
1 Solution
 
Rey Obrero (Capricorn1)Commented:
post a copy of the db and explain, which records you want to see using a select top 100 query..
0
 
Dale FyeCommented:
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

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now