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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s