Database Reference
In-Depth Information
Figure 4.1
The Syntax of the
SELECT
Statement.
Curly braces mean you must choose from one of the choices between
them. So, you can either write a list of column names, or write an expres-
sion, or use *. An asterisk (*) represents all column names within a query
when used in the SELECT statement.
Square brackets mean you can include the items within the square brack-
ets or leave them out entirely. In the SELECT command, you can list just
one column or many columns, or even simply an asterisk (*) if you choose.
The lowercase words are always replaced with actual names of tables,
columns, schemas, and so on. The words in the syntax give you a hint on
what should be used. This structure is just the bare bones of the SELECT
command. Other chapters cover all of the many variations and options
available for the SELECT command.
The complete syntax definition of the SELECT command in Oracle's
SQL documentation takes up five pages. The description of all the variables
in the command takes up another 25 pages. In this topic, you will build
gradually on your knowledge, chapter by chapter, until you have enough
knowledge of the SELECT command to write complex queries easily.
Note:
Details of Backus-Naur syntax conventions can be found in Chapter 1.
This topic almost always follows a slight variation on that theme, described in
Chapter 1. Any variations are generally specific to particular chapters and
noted at the beginning of those chapters.
Let's look at a few examples.
 
Search WWH ::




Custom Search