Portable SQL/Statements/Data retrieval/Join syntax

From Linuxnetworks
< Portable SQL‎ | Statements/Data retrieval
Revision as of 12:49, 22 September 2007 by Nose (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

SQL supports several ways to join the rows of two or more tables.

Inner join

SELECT column-list
FROM table1
[INNER] JOIN table2 ON table1.key = table2.key
WHERE conditions

Left join

SELECT column-list
FROM table1
LEFT JOIN table2 ON table1.key = table2.key
WHERE conditions



Back to Overview