FROM/WHERE Join Syntax

A skeleton version of FROM/WHERE join syntax is this:

SELECT select_list
FROM table_1, table_2 [, table_3]...
						WHERE [table_1.]column  join_operator  [table_2.]column
					

The join operator in the first several examples is the equal sign (=). The FROM clause's table list must include at least two tables, and the columns specified in the WHERE clause must be join-compatible. When the join columns have identical names, you must qualify the columns with their table names in the select list and in the WHERE clause.

For example, if you wanted to know the names and positions of the editors of Secrets of Silicon Valley (PC8888), you'd need a join on a column that exists in the two relevant tables:

SQL
 select ed_lname, ed_fname, ed_pos ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.