Skip to main content

SQL Order By

 SQL Order By

 

ORDER BY keyword is used to sort or filter the data in ascending or descending order.




Sort Username from Customer Table:

SELECT * FROM Customer ORDER BY Username.



Sort Username is ascending order from Customer Table:

SELECT * FROM Customer ORDER BY Username ASC.



Sort Username is descending order from Customer Table:

SELECT * FROM Customer ORDER BY Username DESC.

SELECT Username,Address FROM Customer ORDER BY Username DESC.

Comments