Order by in mysql

When we want the value in ascending or descending order through the column then we use Order by operator

Note:- By default Order is ascending we can change into descending order.

mysql> SELECT col1,col2,col3,col4 FROM tablename ORDER BY col1 DESC;

mysql> SELECT col1,col2,col3,col4 FROM tablename ORDER BY col1 ASC;