MySQL Forums
Forum List  »  Newbie

Re: Cacti - Centos 7 - MYSQL Table ORDER BY issue
Posted by: Phillip Ward
Date: June 26, 2017 05:44AM

Quote

... its clear that the table is being ordered via the ID ...

Actually, it's not being ordered by anything at all. MySQL is just returning the rows in the order that they happen to be in the table. That's not the same as the order of ID, it's just coincidence. Try deleting a row and re-inserting it wit the same ID; it'll drop to the end of the table).

Not that it matters.
Rows in Relational Database Tables have no implicit ordering.

The only way to guarantee the order of rows retrieved is with the "order by" clause on the select statement.

Regards, Phill W.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.