> 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?
What you've also got to remember is that the AutoNumber does NOTHING to the order unless you specify it... All it does is create a new number every time you append a record If it's the Primary Key, then it's slightly different, but it's still not guaranteed When you don't specify an order, the Db just returns the entries in the order it feels like at the time, this is usually close to the one that is in the PK, but it's in no way guaranteed You should use "order by" unless you only want one record, in which case I'd say use "top 1", or it doesn't matter which order they're in (like an update routine) Philip Arnold Technical Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 F: +44 (0)20 8686 7911 An ISO9001 registered company. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ********************************************************************** ______________________________________________________________________ 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/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

