How to use ORDER BY query in MySQL

ORDER BY Query:

  • used to sort the result-set by one or more columns
  • ORDER BY keyword sorts the records in ascending order by
  • To sort the records in a descending order, you can use the
  • By default, it’s ascending order

Query –

select Salary from employee order by Salary Order By

 

 

 

select Emp_ID,FirstName,LastName,Department,Mobile_No,Salary,Address from employee order by Salary

Order By Data