MySQL Sort Descending: ORDER BY Guide

In MySQL, the ORDER BY clause can be used to sort query results in descending order. For example, if we have a table named students with columns name and score, and we want to sort the results by score in descending order, we can use the following statement:

SELECT * FROM students ORDER BY score DESC;

The query results will be sorted in descending order based on the values in the score column. To sort in ascending order instead, you can change DESC to ASC.

bannerAds