ORDER-BY-Keyword-in-SQL

ORDER BY Keyword in SQL

ORDER BY Keyword is used to sort record in ascending or decending order.

If you want to learn how to create a table, insert data into it and select record from table see my previous post   Create Table Insert Data Into Table and Select Data in SQL.

Suppose you have table csclass and you sort table csclass record by marks colums.

See below

ORDER-BY-Keyword-in-SQL

 

ASC Option-

 

By default ORDER BY keyword sorts in ascending order. So, you can use ASC option or not result will be sorted in ascending order, see below.

ORDER-BY-with-ASC-Option

DESC Option-

It can be used to sort record into descending order  see below.

ORDER-BY-with-DESC-Option

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

©Postnetwork-All rights reserved.