List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:February 25 2008 4:31pm
Subject:Re: records ordered incorrectly
View as plain text  
In the last episode (Feb 25), Saravanan said:
> Hi Lists,
> 
> I have created a procedure to calculate and update a statistics. It
> works correctly. It updates daily. For a single day alone it shows
> records in reverse order. For other days it shows correctly. Will
> this happen? but the date with time shows the orders in revers check
> the order for "2008-02-22"
> 
> mysql> select * from stats;

You haven't specified an order in your query, so MySQL is free to
return results in any order at all.  Most of the time that will be the
oder the records were inserted, but if you have deleted rows and then
inserted new ones, those records will be inserted into the gaps.  Add
an "ORDER BY datecol" to the end of your query if you want the records
sorted by date.

-- 
	Dan Nelson
	dnelson@stripped
Thread
records ordered incorrectlySaravanan25 Feb
  • Re: records ordered incorrectlyDan Nelson25 Feb