Specifying the Data Source

 

A SELECT statement will always have a FROM clause, indicating the table or tables from which records will be drawn. If a field name is included in more than one table in the FROM clause, precede it with the table name and the "." (dot) operator. In the following example, the Department field is in both the Employees table and the Supervisors table. The SQL statement selects Department from the Employees table and SupvName from the Supervisors table:

 

SELECT Employees.Department, SupvName
FROM Supervisors, Employees
WHERE Employees.Department = Supervisors.Department

 

When the FROM clause lists more than one table, the order in which they appear is not important. The table list can contain table names, table names with correlation names (i.e. user-created aliases to be used as a more meaningful qualifier to column names). It can also contain an outer join that specifies the table names and condition to use for an outer join.