From Clause
- Last Updated: May 15, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
Purpose
Indicates the tables to be used in the Select statement.
Syntax
FROM table_name [table_alias] [,...]
where:
- table_name
- is the name of a table or a subquery. Multiple tables define an implicit inner join among those tables. Multiple table names must be separated by a comma. For example:
- table_alias
- is a name used to refer to a table in the rest of the Select statement. When you specify an alias for a table, you can prefix all column names of that table with the table alias.
Example
This example specifies two table aliases, e for emp and
d for dep:
SELECT e.name, d.deptName
FROM emp e, dep d
WHERE e.deptId = d.id
The equal sign (=) includes only matching rows in the results.