Press "Enter" to skip to content

mysqlorderby

MySQL ORDER BY clause

The MySQL ORDER BY clause will return output rows in a specific order.
Ascending order is default
Specify order with ASC and DESC

SYNTAX


SELECT
columns
FROM
table_name
WHERE
where_conditions
ORDER BY columns

Example for MySQL ORDER BY clause

The MySQL ORDER BY clause will return output rows in a specific order.
Ascending order is default
Specify order with ASC and DESC

SYNTAX


SELECT
columns
FROM
table_name
WHERE
where_conditions
ORDER BY columns

Output of Above Example


+——————-+
| name |
+——————-+
| Alger |
| Alkmaar |
| Almere |
| Amersfoort |
| Amsterdam |
| Annaba |
| Apeldoorn |
| Arnhem |
| ´s-Hertogenbosch |
| Batna |
+——————-+
10 rows in set (0.00 sec)