>

FROM Clause

Description

Specifies the tables or queries that contain the fields listed in the SELECT statement.

Syntax

SELECT fieldlist
FROM tableexpression [IN externaldatabase]

A SELECT statement containing a FROM clause has these parts.

Part

Description

fieldlist

The name of the field or fields to be retrieved along with any field-name aliases, SQL aggregate functions, selection predicates (ALL, DISTINCT, DISTINCTROW, or TOP), or other SELECT statement options.

tableexpression

An expression that identifies one or more tables from which data is retrieved. The expression can be a single table name, a saved query name, or a compound resulting from an INNER JOIN, LEFT JOIN, or RIGHT JOIN.

externaldatabase

The full pathname of an external database containing all the tables in tableexpression.


Remarks

FROM is required and follows any SELECT statement.

The order of the table names in tableexpression isn't important.

For improved performance and ease of use, it's recommended that you use an attached table instead of an IN clause to retrieve data from an external database.

The following example shows how you can retrieve data from the Employees table:


SELECT LastName, FirstName
FROM Employees;
See Also

IN Clause; INNER JOIN Operation; LEFT JOIN, RIGHT JOIN Operations; SQL Aggregate Functions; WHERE Clause.

Specifics (Microsoft Access)

If you include a query or table name in the FROM clause of a SQL statement, that query or table will be automatically added to the Query window.

Conversely, any table or query that you add to the Query window will be included in the FROM clause of the corresponding SQL statement.