Oracle Tutorial

What is Oracle
SQL Keywords

Oracle Wildcards

Oracle Wildcards

Oracle Aliases

Oracle Aliases

MySQL Tutorial

MySQL Tutorial

PL/SQL Tutorial

PL/SQL Tutorial

Oracle Interview Questions

Oracle Interview Questions and Answers


Oracle INNER JOIN

In Oracle, INNER JOIN is used to fetch records from more than one table that have matching field or column values in both tables. It appears immediately after the FROM clause.

Oracle INNER JOIN Syntax

To fetch records from more than one tables that have matching field or column values in both tables, use the following syntax:

Syntax

SELECT col1, col2,....
FROM tablename1
INNER JOIN tablename2 
ON tablename1.col1 = tablename2.col1;

Parameters:

tablename1 & tablename2: The table name from which you want to fetch records.

col1: The column or field name that will be return.

Oracle INNER JOIN example

The following Oracle, fetching "accountName" fields value from "tblbankdemataccountcharges" table and "banks" fields value from "tblbankheadquartersandaddress" table using INNER JOIN, both have matching column values in tables :

Example

SELECT A.accountName, B.banks 
FROM tblbankdemataccountcharges A 
INNER JOIN tblbankheadquartersandaddress B
ON A.bankId = B.pk LIMIT 6;

Note:

In the above example, we are fetching "accountName" fields value from "tblbankdemataccountcharges" table and "banks" fields value from "tblbankheadquartersandaddress" table, both have matching column values in tables.