3 Way join with different column names.
Hi,
I have 3 files each having 2 cols
e.g
File1
empid deptid
1 100
2 200
3 200
4 100
5 300
File2
empid salary
1 10
2 20
3 30
4 40
5 50
6 60
File3
deptid deptname
100 A
200 B
300 C
400 D
in the output i want total amt spent on each dept i.e A,B,C,D which would be a sum in rollup for each dept(100,200,300,400) salary of each employee.
So here i will have to join
File1.empid =File2.empid (which gives salaries) AND
File1.deptid = File3.deptid (which gives dept name)
So... in o/p i want dept_name and amt_spent_each_dept
My solution has
File1 ---
File2 ------[ JOIN] ---[Rollup] --- [File4 as output]
File3 ---
But what condition can i have in JOIN component to join these 3 tables ?
Questions by vital_parlsey answers by vital_parlsey
Showing Answers 1 - 5 of 5 Answers
Related Answered Questions
Related Open Questions
3 Way join with different column names.
I have 3 files each having 2 cols
e.g
File1
empid deptid
1 100
2 200
3 200
4 100
5 300
File2
empid salary
1 10
2 20
3 30
4 40
5 50
6 60
File3
deptid deptname
100 A
200 B
300 C
400 D
in the output i want total amt spent on each dept i.e A,B,C,D which would be a sum in rollup for each dept(100,200,300,400) salary of each employee.
So here i will have to join
File1.empid =File2.empid (which gives salaries) AND
File1.deptid = File3.deptid (which gives dept name)
So... in o/p i want dept_name and amt_spent_each_dept
My solution has
File1 ---
File2 ------[ JOIN] ---[Rollup] --- [File4 as output]
File3 ---
But what condition can i have in JOIN component to join these 3 tables ?
Profile Answers by vital_parlsey Questions by vital_parlsey
Questions by vital_parlsey answers by vital_parlsey
Related Answered Questions
Related Open Questions