ORDER BY
Learn ORDER BY (SELECT Queries, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Introduction ORDER BY sorts the result by one or more expressions, ascending (default) or DESC . It is the only way to get a guaranteed order; without it MySQL may return rows in any order, which can change after an index or plan change.