Can someone please give me a simple explanation of an inner equijoin?
I'm finding explanations found via google quite hard to understand.
Can someone please give me a simple explanation of an inner equijoin?
I'm finding explanations found via google quite hard to understand.
An inner equijoin is simply an inner join that only uses the equality operator (no < or >) in the join predicate.
Here is a good explanation:
Equi Join: Equi Join returns all the columns from both tables and filters the records satisfying the matching condition specified in Join “ON” statement of sql inner join query.
USE NORTHWIND
SELECT * FROM CATEGORIES C INNER JOIN
PRODUCTS P ON P.CATEGORYID = C.CATEGORYID
Equi join is the join which contains an equal operator in its join condition.
From Join (SQL)
An equi-join, also known as an equijoin, is a specific type of comparator-based join, or theta join, that uses only equality comparisons in the join-predicate. Using other comparison operators (such as <) disqualifies a join as an equi-join.
These are joins where only equality operators are used.
Eg.
SELECT *
FROM employee
INNER JOIN department
ON employee.DepartmentID = department.DepartmentID
It's just the simple join on a column (or columns) between two tables when the values in the columns must match (ie are equal) and there must be a row in both tables in order for a row to end up in the resultset.
eg
create table departments( department_id number, department_name varchar2(30))
create table employees (employee_id number, employee_name varchar2(30), department_id number)
select d.department_name, e.employee_id
from employees e
inner join departments d
on (d.department_id = e.department_id)
inner equijoin is simple inner join that uses only equality comparisons in the join-predicate