Professional Documents
Culture Documents
Merge Queries
Merge Queries
Merge Queries
When ever we need to see the data from more tahn one table in single select
statement we need to use joins
instead of loading all the tables in to power pivot join them as single table in
power query and load into power piovot
like empno, ename, job from emp table dept name,loc from dept table and manager
information from manger table
Joins will help us to to show the data from more than one table
In the power query if you want to merge the tables we have different join types
Types of joins
1) Cartesian join/Cross join 1%
2) Inner join/Equi join/Natural Join 10%
3)Left outer join(90%)
4)Right outer join
5)Full outer join
6) Self Join --> Joing a table to itself is called self join
EMP DEPT
Inner join:
It will give only matching records only
When ever you want to perform the inner join we need a common column in the both
tables
Common column means not the same name of the column, the data under the column
should be same
Left Outer Join: Matching Records(Inner Join Records)+Non Mathcing records from
leftside table
EMP DEPT
Empno Ename Sal Deptno Deptid DName Loc
1001 Srinivas 5000 10 10 sales hyd
1002 Raju 4000 20 20 hr bng
1003 Sudheer 3000 10 30 fin Che
1004 Mahesh 6000 40
Right Outer Join: Matching Records(Inner Join Records)+ Non matching records from
the right side
EMP DEPT
Empno Ename Sal Deptno Deptid DName Loc
1001 Srinivas 5000 10 10 sales hyd
1002 Raju 4000 20 20 hr bng
1003 Sudheer 3000 10 30 fin Che
1004 Mahesh 6000 40
Full Outer Join: Matching Records(Inner Join Records)+ Non matching records from
the Left side +Non matching records from the Right side
EMP DEPT
Empno Ename Sal Deptno Deptid DName Loc
1001 Srinivas 5000 10 10 sales hyd
1002 Raju 4000 20 20 hr bng
1003 Sudheer 3000 10 30 fin Che
1004 Mahesh 6000 40
T1 T2
C1 C1
1 1
2 1
2 2
3 4