Snippet Name: INNER JOIN example and syntax
Description: The INNER JOIN keyword return rows when there is at least one match in both tables.
An inner join requires each record in the two joined tables to have a matching record. An inner join essentially combines the records from two tables (A and B) based on a given join-predicate. The result of the join can be defined as the outcome of first taking the Cartesian product (or cross-join) of all records in the tables (combining every record in table A with every record in table B) - then return all records which satisfy the join predicate.
Also see: » ANSI Joins: FULL JOIN
» ANSI Joins: OUTER JOIN
» ANSI Joins: CROSS JOIN
» ANSI Joins: INNER JOIN
» Self-join example and syntax
» FULL JOIN example and syntax
» RIGHT JOIN example and syntax
» LEFT JOIN example and syntax
Comment: (none)
Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 07th, 2009
|
SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
-- for example:
SELECT Person.LastName, Person.FirstName, Sales.OrderNo
FROM Person
INNER JOIN Sales
ON Person.P_Id=Sales.P_Id
ORDER BY Person.LastName |