Database Reference
In-Depth Information
6
Sorting Rows
In this chapter:
How are rows in queries sorted both manually and automatically?
How are null values affected when sorting rows?
What are the types of sorting methods for the ORDER BY clause?
This chapter extends the syntax of the SELECT statement by examining
ORDER BY clause sorting and the various detailed aspects of SELECT
statement ORDER BY clauses.
6.1
ORDER BY Clause Syntax
Previous chapters have examined the SELECT, FROM, and WHERE
clauses. This chapter adds the ORDER BY clause to the SELECT state-
ment. Here is a quick description of each clause:
SELECT
. List all the columns you want to see in your report here.
Separate them with commas. Use an asterisk (*) instead of a list of
columns to automatically show all columns in the queried table.
FROM
. Put the table name here. Use an alias for easier referencing in
the other clauses.
WHERE (optional)
. Add conditions that filter out rows from your
report here. Use various comparison conditions and logical opera-
tors between each filter. A query without a WHERE clause returns
all rows.
Search WWH ::




Custom Search