Sorting Data
Learn how to sort using the ORDER BY clause.
We'll cover the following...
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 SalesPersonFROM 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
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 ...