How to sort the rows in SQL?
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,
Ads