Contents Index Using calculated columns Using indexes to improve ORDER BY performance

ASA Getting Started
  Selecting Data from Database Tables

Ordering query results


Unless otherwise requested, the database server returns the rows of a table in an order that has no meaning. Often it is useful to look at the rows in a table in a more meaningful sequence. For example, you might like to see products in alphabetical order.

You order the rows in a result set by an ORDER BY clause to the end of the SELECT statement. This SELECT statement has the following syntax:

SELECT column-name-1column-name-2,...
FROM table-name
ORDER BY order-by-column-name

where column-name-1, column-name-2, and table-name should be replaced with the names of the desired columns and table you are querying, and where order-by-column-name is a column in the table. As before, you can use the asterisk as a short form for all the columns in the table.

List the products in alphabetical order

Notes 

Using indexes to improve ORDER BY performance

Contents Index Using calculated columns Using indexes to improve ORDER BY performance