In the last episode (Aug 15), Martijn Tonies said: > >I have a table with 1600 student locks in random order. I would like > >them permanently sorted by the locker number they are assigned to. I > >assumed that ... > > > >~ I would copy the table under a different name > >~ Delete all records from this copy > >~ Write a statement that would copy the records from the original > > table into the copied table in SORTED order > >~ Delete the original table > >~ Rename the copy to the same name as the original > > > >Question 1: Is there a better way to get the desired result? > >Question 2: If not, what would the Insert/Select statement look like > > that would copy the records over in sorted order? > > Tables aren't sorted. Period. > > Only result-sets can be sorted.
That said, you can still order the rows in the physical database to optimize record-at-a-time sequential access to a table: http://dev.mysql.com/doc/refman/5.0/en/alter-table.html#id2995284 With a table of only 1600 rows, there is no need to do this IMHO. -- Dan Nelson [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]