Home » MariaDB Order By

MariaDB ORDER BY Clause

In MariaDB database, ORDER BY Clause is used to sort the records in your result set in ascending or descending order.

Syntax:

Note: You can sort the result without using ASC/DESC attribute. Bydefault the result will be sorted in ascending order.


ORDER BY Clause without using ASC/DESC attributes

Use the “Employees” table, having the following data:

Mariadb Order by clause 1

Example:

Output:

Mariadb Order by clause 2


ORDER BY Clause with DESC Attribute

Output:

Mariadb Order by clause 3


ORDER BY Clause with ASC Attribute

Output:

Mariadb Order by clause 4

You may also like