SQL Order By Desc

SQL Order By Desc is used to sort data in descending order.

Syntax


SELECT * FROM table_name
WHERE condition ORDER BY column_name ASC|DESC;



StudentID StudentName StudentCity
1 Rahul Chandigarh
2 Karan Mohali
3 Neha Gurdaspur
4 Manpreet Shimla
5 Ajay Delhi



SELECT * FROM Student
WHERE 1 ORDER BY StudentCity DESC



StudentID StudentName StudentCity
4 Manpreet Shimla
2 Karan Mohali
3 Neha Gurdaspur
5 Ajay Delhi
1 Rahul Chandigarh

Back To Top