Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I limit query rows in cases with 'ties'?

Status
Not open for further replies.

married2themachine

Programmer
Mar 11, 2004
5
US
I'm trying to limit query output rows to 10...but when my sort column has records with the same value (ties), all of them display (over and above the Top 10 that I have set).

I have tried 'select distinct top 10 ...' but since the other fields are different, each record is distinct.

Will I have to drop the data into a temporary table with row limits?
 
Hi!

Choose a second field to sort by and as long as that field is different after the 10th record your query will limit it to ten.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top