Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL How to sort the rows in SQL?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


hemant kumar
How to sort the rows in SQL?
1 Answer(s)      3 years and 11 months ago
Posted in : SQL


How to sort the rows in SQL?


Advertisement
View Answers

November 19, 2010 at 4:17 PM


Hi,

Here is the answer,

The ORDER BY clause allows you to sort the records in your result set. The ORDER BY clause can only be used in SELECT statements.

The syntax for the ORDER BY clause is:

SELECT column_list
FROM tablename
WHERE expression
ORDER BY column ASC / DESC;

The ORDER BY clause sorts the result set based on the columns specified. If the ASC or DESC value is omitted, it is sorted by ASC.

ASC indicates ascending order. (default)

DESC indicates descending order.

Thanks,



Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com