Mar 25, 2011

Sqlserver HOW TO USE ORDER BY KEY WORD

The ORDER BY keyword is used to sort the result-set by a specified column.
If you want to sort the records in a descending order, you can use the DESC keyword.

Syntax :

SELECT column_name FROM table_name
ORDER BY column_name ASC/DESC

Example :
SELECT  *  FROM FLIGHT_DETAILS
ORDER  BY DESC

The ORDER BY keyword sort the records in ascending order by default.

No comments:

Post a Comment