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.
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
Example
select * from mcninvoices
order by invoicetotal desc
|
Output