skip to main content
SQL Statements and Extensions for the Salesforce Driver : Select : Select Clause : From Clause
  
From Clause
Purpose
The From clause 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:
SELECT * FROM emp, dep
Subqueries can be used instead of table names. Subqueries must be enclosed in parentheses. See Subquery in a From Clause for an 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
The following 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.
* Join in a From Clause
* Subquery in a From Clause