How to use ORDER BY in Mysql

In this article, you will learn How to use ORDER BY in Mysql.

Syntax:-

SELECT column1, column2, ...
FROM table_name
ORDER BY column1, column2, ... ASC/DESC;

ORDER BY DESC Example:-

SELECT * FROM Students ORDER BY StudentID DESC;

ORDER BY Few Columns Example:-

SELECT * FROM Students ORDER BY Country, StudentName;

You may also like:- How to Fetch Data From Mysql Database using PHP

check on Facebook

Leave a Reply

Your email address will not be published. Required fields are marked *