MySQL Sorting Results

In this tutorial you will learn about the MySQL Sorting Results and its application with practical example.

The result set returned by the SELECT Query is free from any sort order unless you specify it in the SELECT statement.ORDER BY clause is used to sort the result set by a specified column or columns.The ORDER BY clause sorts the records in ascending order by default. To sort the result set in a descending order, use the DESC keyword.

Table Of Contents

Syntax:

  • We can sort returned result set on any column provided.
  • We can sort the result set on column or columns.
  • ASC or DESC keyword is used to get result in ascending or descending order accordingly. Default is ascending order.

 

In this tutorial we have learn about the MySQL Sorting Results and its application with practical example. I hope you will like this tutorial.