Order By Clause in SQL

Order By Clause in SQL

Order By Clause in SQL-

The order by clause is basically used for display or arrange data from table column with ascending or descending order. If we want to display data with order format like alphabetical then order by clause is used mainly.

  • The order by clause with any change by default in ascending order mainly.
  • If we want to display data in descending order then we use DESC method for data display in descending order.
  • After we want the data in ascending order then we can use ASC method for display data.

Example-

agrigate

SELECT * FROM Emp ORDER BY Emp_Name, Salary DESC;
OUTPUT-
agrigate1
SELECT * FROM Emp ORDER BY Emp_Name ASC, Emp_id DESC;
OUTPUT-
agrigate

 

 

Amol Shinde

Amol Shinde

Work as Assistant Professor and Web Developer.

Leave a Reply

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