MySQL Default Order

In the SQL world, order is not an inherent property of a set of data. Thus, you get no guarantees from your RDBMS that your data will come back in a certain order – or even in a consistent order – unless you query your data with an ORDER BY clause.

If an <order by clause> is not specified, then the ordering of the rows is implementation-dependent.

Default Orders

MySQL Server v5.6, InnoDB

If select fields only in unique key/index, the default order is ordered by unique key/index.

if select fields only in primary key, the default order is ordered by unique key/index or primary key

if select fields contain a field that is not in the primary key, unique key, and index, the default order is ordered by the primary key.


Do not depend on order when ORDER BY is missing.

Always specify ORDER BY if you want a particular order.


[1] What is The Default Sort Order of SELECTS with no ORDER BY Clause?

[2] What is the default order of records for a SELECT statement in MySQL?

[3] SQL: What is the default Order By of queries?