How to Work with ORDER BY Clause in SQL

In this article I am going to explain how to work with ORDER BY Clause in SQL.
  • 1630

Introduction

In this article I am going to explain how to work with  ORDER BY Clause in SQL. ORDER BY clause is used to sort the data into result set. We can sort one or more column into result set according to need or choice. We can sort data in column in either ascending order (ASC) or descending  order (DESC). By default it is ASC order.

Example

select * from mcninvoices
order by invoicetotal

Output

Clipboard08.jpg

Example

select * from mcninvoices
order by invoicetotal desc

Output

Clipboard10.jpg


© 2018 DotNetHeaven. All rights reserved.