Sorting the records in a recordset

Sorting the records in a recordset

Use the ORDER BY clause to sort the records in your recordset. For example, suppose you want to sort the records in the recordset by customer earnings, from the lowest to the highest. In SQL, order the records as follows:

SELECT LastName, FirstName, Earnings FROM Customers 
ORDER BY Earnings

By default, the ORDER BY clause sorts records in ascending order (1, 2, 3... or A, B, C...). If you want to sort them in descending order, from the highest earnings to the lowest, use the DESC keyword as follows:

ORDER BY Earnings DESC


Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly