ORACLE | ||||||||
| ||||||||
| ||||||||
| ||||||||
| ||||||||
| ||||||||
| ||||||||
| ||||||||
|
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.
SELECT column_list
FROM table1, table2....
WHERE table1.column_name =
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.
SELECT *
FROM table1
JOIN table2
[ON (join_condition)]
Let' take two tables "agents" and "customer".
AGENT_ID | AGENT_NAME | AGENT_CITY |
---|---|---|
3 | Ajay | Ahmedabad |
7 | Nirupam | London |
11 | Teja | Mumbai |
CUSTOMER_ID | FIRST_NAME | LAST_NAME |
---|---|---|
1 | Neha | Ullal |
2 | Richa | Kohli |
3 | Swetha | Pandit |
4 | Jansi | Kapoor |
SELECT agents.agent_city,customer.last_name,
customer.first_name
FROM agents,customer
WHERE agents.agent_id=customer.customer_id;
AGENT_CITY | FIRST_NAME | LAST_NAME |
---|---|---|
Ahmedabad | Swetha | Pandit |