skip to main content
SQL Statements for Flat-File Drivers : Select Statement : From Clause
  
From Clause
The From clause indicates the tables to be used in the Select statement. The format of the From clause is:
FROM table_names [table_alias]
table_names can be one or more simple table names in the current working directory or complete path names.
table_alias is a name used to refer to a table in the rest of the Select statement. Database field names may be prefixed by the table alias. Given the table specification:
FROM emp E
you may refer to the LAST_NAME field as E.LAST_NAME. Table aliases must be used if the Select statement joins a table to itself. For example:
SELECT * FROM emp E, emp F WHERE E.mgr_id = F.emp_id
The equal sign (=) includes only matching rows in the results.
If you are joining more than one table, you can use LEFT OUTER JOIN, which includes non-matching rows in the first table you name. For example:
SELECT * FROM T1 LEFT OUTER JOIN T2 on T1.key = T2.key