tags:

views:

96

answers:

5

Can someone please give me a simple explanation of an inner equijoin?

I'm finding explanations found via google quite hard to understand.

+2  A: 

An inner equijoin is simply an inner join that only uses the equality operator (no < or >) in the join predicate.

Jim H.
+1  A: 

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.

Lukasz Lysik
+4  A: 

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
astander
i like how OP found "explanations found via google" hard to understand, but an exact paste from wikipedia (the first search match for "inner equijoin" on google) to be quite comprehensible =) but hey, it's correct and all, so you've got my +1
David Hedlund
A: 

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)
CMG
A: 

inner equijoin is simple inner join that uses only equality comparisons in the join-predicate

http://en.wikipedia.org/wiki/Join%5F%28SQL%29#Equi-join

Alex Reitbort