Oracle EQUI JOIN

Oracle Equi join returns the matching column values of the associated tables. It uses a comparison operator in the WHERE clause to refer equality.

Syntax

  1. SELECT column_list   
  2. FROM table1, table2….  
  3. WHERE table1.column_name =  
  4. table2.column_name;  

Equijoin also can be performed by using JOIN keyword followed by ON keyword and then specifying names of the columns along with their associated tables to check equality.

Syntax

  1. SELECT *  
  2. FROM table1   
  3. JOIN table2  
  4. [ON (join_condition)]   

Oracle EQUI JOIN Example

Let’ take two tables “agents” and “customer”.

Agents table

Oracle Equi Join

Agent data

Oracle Equi Join 2

Customer table

Oracle Equi Join 3

Customer data

Oracle Equi Join 4

Execute this query

  1. SELECT agents.agent_city,customer.last_name,    
  2. customer.first_name   
  3. FROM agents,customer    
  4. WHERE agents.agent_id=customer.customer_id;    

Output

Oracle Equi Join 5

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *