7.12.2 Inner join using INNER JOIN
The following is an example of an inner join using INNER JOIN.
-
Tables to be retrieved from
-
SELECT statement to be run
SELECT * FROM "USERSLIST" INNER JOIN "SALESLIST" ON "USERSLIST"."USERID"="SALESLIST"."USERID"
From the Cartesian product of the left and right table references (the Cartesian product of USERSLIST and SALESLIST), produce a joined table consisting of the rows for which the search condition specified in the join specification (the underlined portion above) is true.
-
Cartesian product of USERSLIST and SALESLIST (all row combinations)
Each row of SALESLIST is paired with each row of USERSLIST.
-
Retrieval results
The joined table consists of the rows within the Cartesian product of USERSLIST and SALESLIST for which the search condition ("USERSLIST"."USERID"="SALESLIST"."USERID") is true.
The result in this example is a list of customers who have purchased products.
-