Difference between a equijoin and a union?

Showing Answers 1 - 4 of 4 Answers

apiplani

  • Feb 12th, 2006
 

Indeed both equi join and the Union are very different. Equi join is used to establish a condition between two tables to select data from them.. eg

select a.employeeid, a.employeename, b.dept_name from

employeemaster a , DepartmentMaster b

where a.employeeid = b.employeeid;

This is the example of equijoin whereas with a Union allows you to select the similar data based on different conditions eg

select a.employeeid, a.employeename from

employeemaster a where a.employeeid >100 b.employeeid

Union

select a.employeeid, a.employeename from

employeemaster a where a.employeename like 'B%'

the above is the example of Union where in we select employee name and Id for two different conditions into the same recordset and is used thereafter.

  Was this answer useful?  Yes

aruna

  • Apr 3rd, 2006
 

for equijoin there must be relationship between two tables

but for union no need to have any relation between the two tables

but equijoin & union are used with more than one table

  Was this answer useful?  Yes

Eqiui join is totally differene from unions

Equijoin depends on a condition involving columns of both tables but where as in

Union you can specify a condition based on a columns of the individual tables

  Was this answer useful?  Yes

Equi Join is cartisan product of two tables and result is matching values of these tow tables but
both have common column.

Union is just append two tables and restricts the duplicate rows and both tables have same number of columns.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions