...

/

Sorting Data

Sorting Data

Learn how to sort using the ORDER BY clause.

Revisiting Task 1

Let’s revisit task 1, where we created a report listing salespersons. Here is what we did:

Press + to interact
SELECT DISTINCT SalesPerson
FROM SalesData

We had successfully generated the report. Nevertheless, we overlooked the requirement that the names of the salespersons in the sample report should be sorted in ascending order. 

Press + to interact
Report 1: List of salespersons
Report 1: List of salespersons

To accomplish this, it is necessary to organize the results in ascending order. SQL provides a mechanism to streamline this process. By instructing SQL to arrange the outcomes in either ascending or descending order, the system effortlessly executes the ...