NEWSubscribe to Receive Free E-mail UpdatesSubscribe

What is Inner Join In SQL Visual Explanation

An SQL join clause combines records from two or more tables in a database. It creates a set that can be saved as a table or used as it is. A JOIN is a means for combining fields from two tables by using values common to each. ANSI-standard SQL specifies five types of JOIN: INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER and CROSS. As a special case, a table (base table,view, or joined table) can JOIN to itself in a SELF-JOIN.

A programmer writes a JOIN statement to identify the records for joining. If the evaluated predicate is true, the combined record is then produced in the expected format, a record set or a temporary table.

Assume we have the following two tables. Table A is on the left, and Table B is on the right. We'll populate them with four records each.


INNER JOIN
Inner join produces only the set of records that match in both Table A and Table B.
SELECT * FROM TableA INNER JOIN TableB ON TableA.name = TableB.name


Post a Comment

0 Comments