On Thursday 14 February 2002 09:54, Bryan McCloskey wrote: > Greetings, > > How do I get the rows in a table to be in a different > order? I know I can sort a SELECT statement with an > ORDER BY clause, but how do I make this a permanent > adjustment to the table, so that all future SELECTs > will produce ordered data? How does MySQL know what > orders the rows are in (how are they actually stored), > and how can I change that? > > Here's what's happening: say I have a table with an ID > field like this: > > ID ...
Well, in most RDBMS you would use a VIEW to accomplish that, but as MySQL has no views, you simply MUST use an ORDER BY when you want a sorted result set! No database guarantees any "natural order" to the way it stores data in tables. Some products do let you specify an index as defaulting to ascending or descending, but you STILL have to say ORDER BY to get sorting in the first place. --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php