Chris, In MSSQL server you can create a "clustered" index that is the actual storage order for the table. Also, in SQL 2000 you can specify the custered order as ascending or descending. This can be very useful if you want to eliminate the "order by" step in a constantly reoccuring query.
Mark -----Original Message----- From: Christopher Olive [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 10:45 AM To: CF-Talk Subject: RE: Query question it's becaus Access is close enought to a RDBMS to not have the concept of "ordering" an unordered recordset. when an RDBMS query is run, it returns the records that match the SELECT statement, in no particular order (unless the ORDER BY clause is used), because the records exist in the relational model, not in a flat model. christopher olive, cto, vp of web development atnet solutions, inc. 410.931.4092 http://www.atnetsolutions.com -----Original Message----- From: Matthew R. Small [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 6:41 PM To: CF-Talk Subject: RE: Query question It's in that order in the access database that I use - using autonumber. And you're right, it is best to use order by. However, I was wondering what would have happened if I needed information in my database in the order that I view it, but it has no logical ordering column. Thanks, - Matt Small -----Original Message----- From: Howie Hamlin [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 6:29 PM To: CF-Talk Subject: Re: Query question How do you know what the order is in the database? That is usually a hidden thing that you wouldn't see. At any rate, it's best prctice to use ORDER BY. Regards, -- Howie Hamlin - inFusion Project Manager On-Line Data Solutions, Inc. - www.CoolFusion.com - 631-737-4668 x101 inFusion Mail Server (iMS) - The Intelligent Mail Server >>> Find out how iMS Stacks up to the competition: http://www.coolfusion.com/imssecomparison.cfm ----- Original Message ----- From: "Matthew R. Small" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 5:59 PM Subject: Query question > I have a query that I run: > > <cfquery name="getshoworder" datasource="intranet"> > select * from showorder > </cfquery> > > > and > > <cfquery name="getshoworder" datasource="intranet"> > select * from showorder_#form.show# order by id > </cfquery> > > Knowing that the "order by id" is in the order that the data exists in > the table, why does the first query mix things up? > > - Matt Small > ______________________________________________________________________ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists