Print Page | Close Window

Select Top Order By problem.

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21016
Printed Date: 29 March 2026 at 8:34pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Select Top Order By problem.
Posted By: zMaestro
Subject: Select Top Order By problem.
Date Posted: 13 August 2006 at 11:08am
I've a problem.
When I select Top 10 and I order by ID, it works fine, but when I order by any other field, it doesn't work.
my code is:
 

SELECT Top 10 * FROM Table WHERE field = 'blah' Order By ID
this returns 10 rows
 

SELECT Top 10 * FROM Table WHERE field = 'blah' Order By Date
this returns all rows
 
Is this normal?



Replies:
Posted By: michael
Date Posted: 13 August 2006 at 3:11pm
No, definately not normal... I never have seen a Top Clause return more then n rows except under some special conditions....

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net