Free Source Code and Tutorials

Custom Search



It defines how the records are to be sorted. By default, it is to order in ascending order(ASC). If we want to sort in descending order, we can use DESC after the column name.




  1. SELECT column_name, column_name
  2. FROM table_name
  3. ORDER BY column_name ASC/DESC, column_name ASC/DESC;


For example, consider the following table Employee:


Employee_id First_name Last_name sex
123 Mack Johnson male
124 Jack Obama male
125 King Khan male



  1. SELECT * FROM Employee
  2.   ORDER BY Employee_id DESC;



This would give the following output:


Employee_id First_name Last_name sex
125 King Khan male
124 Jack Obama male
123 Mack Johnson male








Facebook Comments
(Visited 5 times, 1 visits today)
Share this

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked * © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!

%d bloggers like this: