How do you sort in SQL?

 Posted by ArticlesMaint on 10/3/2009 | Category: Sql Server Interview questions | Views: 15002


Using the “ORDER BY” clause, you either sort the data in ascending manner or descending manner.

select * from sales.salesperson order by salespersonid asc

select * from sales.salesperson order by salespersonid desc


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Puneet20884 on: 12/23/2009
use ORDER BY on the column on which you want to sort giving "ASC" or "DESC" predicates

Login to post response