As far as I know, to sort in reverse order, you could add the DESC (descending) keyword to the name of the column in the ORDER BY clause that you are sorting by.
The default is ascending order; this can be specified explicitly using the ASC keyword.
More details, you could refer to below select exmaple:
select * from emp ORDER BY [Your column name] DESC
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
4 Points
66 Posts
mysql query in reverse order
Jun 26, 2018 09:34 AM|sidu|LINK
Hi all
How to get the result of select * from emp in reverse order
botttom record will show first
Participant
1644 Points
792 Posts
Re: mysql query in reverse order
Jun 26, 2018 09:59 AM|rajesh93180|LINK
Hello sidu,
If your database table have any ID field, fetch the data based on that field in descending order.
Thnaks,
RajeshV.
Mark as answer if you find this post helpful.
Star
9831 Points
3120 Posts
Re: mysql query in reverse order
Jun 27, 2018 05:15 AM|Brando ZWZ|LINK
Hi sidu,
As far as I know, to sort in reverse order, you could add the DESC (descending) keyword to the name of the column in the ORDER BY clause that you are sorting by.
The default is ascending order; this can be specified explicitly using the ASC keyword.
More details, you could refer to below select exmaple:
Related article:
https://dev.mysql.com/doc/refman/8.0/en/select.html
Best Regards,
Brando