Re: MySQL & physical record order: FIFO, LIFO or what?

by jdiaz(at)ivtech.com

 Date:  Wed, 8 Nov 2000 09:01:07 -0700 (MST)
 To:  David Mintz <mambomintz(at)yahoo.com>
 Cc:  hwg-languages(at)hwg.org
 In-Reply-To:  yahoo
  todo: View Thread, Original

A relational database, by definition, is unordered...and MySQL is one of these (nearly all databases are).  This unordering is both in it's retrieval of data as well as columns.  For instance, if you "SELECT * FROM so-and-so", although typically you retrieve your data columns in order of the create table definition, it is not required that they be in this order.  This is why it's better form to list columns in your select statement.  Same holds true for data.  The database is not required to return data rows in any logical order unless you add an 'order by' clause to your select statement.

As you stated, you would be well off to create another column for strentgh to order by, otherwise you're not going to be guaranteed the results you want.

 - Jeff

> Am I correct in concluding that MySQL, if not given an
> order by clause, orders its result set in the order it
> deems best as opposed to the physical order of the
> records?
> 
<snip>

> The members are supposed to rank their language
> combinations in order of strength. That's why the
> order is an issue. Maybe I should add another column
> called strength_factor, an ENUM field with values one
> through 10, and sort on that?
> 

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA