Join in a 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
Join in a From Clause
Purpose
Associates multiple tables within a Select statement. Joins may be either explicit or implicit.
Example A
This is the example from the previous section restated as an explicit inner join:
SELECT e.name, d.deptName
FROM emp e INNER JOIN dep d ON e.deptId = d.id;
FROM table_name {RIGHT OUTER | INNER | LEFT OUTER | CROSS} JOIN table.key ON search-condition
Example B
In
this example, two tables are joined using LEFT OUTER JOIN. T1,
the first table named includes nonmatching rows.
SELECT * FROM T1 LEFT OUTER JOIN T2 ON T1.key = T2.key
If you use a CROSS JOIN, no ON expression
is allowed for the join.