Collection Contents Index The SELECT clause: specifying columns The WHERE clause: specifying rows pdf/chap4.pdf

User's Guide
   PART 1. Working with Databases
     CHAPTER 4. Queries: Selecting Data from a Table       

The FROM clause: specifying tables


The FROM clause is required in every SELECT statement involving data from tables or views.

For Info     The FROM clause can include JOIN conditions linking two or more tables, and can include joins to other queries (derived tables). For information on these features, see Joins: Retrieving Data from Several Tables.

Qualifying table names 

In the FROM clause, the full naming syntax for tables and views is always permitted, such as:

SELECT select-list
FROM owner.table_name 

Qualifying table and view names is necessary only when there might be some confusion about the name.

Using correlation names 

You can give table names correlation names to save typing. You assign the correlation name in the FROM clause by entering it after the table name, like this:

SELECT d.dept_id, d.dept_name 
FROM Department d

All other references to the Department table, for example in a WHERE clause, must use the correlation name. Correlation names must conform to the rules for valid identifiers.


Collection Contents Index The SELECT clause: specifying columns The WHERE clause: specifying rows pdf/chap4.pdf