In SQL Server 7.0, SELECT TOP does not ignore the order by. >From Books Online:
"If the query includes an ORDER BY clause, the first n rows (or n percent of rows) ordered by the ORDER BY clause are output. If the query has no ORDER BY clause, the order of the rows is arbitrary." You may be thinking of SET ROWCOUNT, which does pick the number of rows then applies the order by statement. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 03, 2002 10:41 AM > To: CF-Talk > Subject: Re: SELECT TOP n vs MaxRows... > > > > are you sure about it ignoring ORDER BYs? I just ran a test with SQL > Server > > 7.0 and it returned the correct results and I included an order > by. here > are > > the results > > 100% sure, BoL & my own misadventures. clustered/index on that column? > > > ______________________________________________________________________ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

