I have two tables I need to join and they look like the following
The first table is a table of jobs and employees assigned to that job
Table 1
Job Number | Emp ID |
---|---|
00001 | 1750 |
00001 | 1550 |
00001 | 1350 |
00002 | 1630 |
00002 | 1530 |
The second table is lists jobs and each job is repeated by the number of weeks a job is expected to last
Table 2
Job Number | # of weeks | Week Count | Total Hours | Labor per Week |
---|---|---|---|---|
00001 | 5 | 1 | 20 | 4 |
00001 | 5 | 2 | 20 | 4 |
00001 | 5 | 3 | 20 | 4 |
00001 | 5 | 4 | 20 | 4 |
00001 | 5 | 5 | 20 | 4 |
00002 | 10 | 1 | 100 | 10 |
00002 | 10 | 2 | 100 | 10 |
00002 | 10 | 3 | 100 | 10 |
00002 | 10 | 4 | 100 | 10 |
00002 | 10 | 5 | 100 | 10 |
00002 | 10 | 6 | 100 | 10 |
00002 | 10 | 7 | 100 | 10 |
00002 | 10 | 8 | 100 | 10 |
00002 | 10 | 9 | 100 | 10 |
00002 | 10 | 10 | 100 | 10 |
I need to join these into one table where every row in table 2 will increase by a factor equal to the number of employees in table 1. So that it results in a table like the following
Joined Table
Job Number | # of weeks | Week Count | Total Hours | Labor per Week | Employee |
---|---|---|---|---|---|
00001 | 5 | 1 | 20 | 4 | 1750 |
00001 | 5 | 2 | 20 | 4 | 1750 |
00001 | 5 | 3 | 20 | 4 | 1750 |
00001 | 5 | 4 | 20 | 4 | 1750 |
00001 | 5 | 5 | 20 | 4 | 1750 |
00001 | 5 | 1 | 20 | 4 | 1550 |
00001 | 5 | 2 | 20 | 4 | 1550 |
00001 | 5 | 3 | 20 | 4 | 1550 |
00001 | 5 | 4 | 20 | 4 | 1550 |
00001 | 5 | 5 | 20 | 4 | 1550 |
00001 | 5 | 1 | 20 | 4 | 1350 |
00001 | 5 | 2 | 20 | 4 | 1350 |
00001 | 5 | 3 | 20 | 4 | 1350 |
00001 | 5 | 4 | 20 | 4 | 1350 |
00001 | 5 | 5 | 20 | 4 | 1350 |
00002 | 10 | 1 | 100 | 10 | 1630 |
00002 | 10 | 2 | 100 | 10 | 1630 |
00002 | 10 | 3 | 100 | 10 | 1630 |
00002 | 10 | 4 | 100 | 10 | 1630 |
00002 | 10 | 5 | 100 | 10 | 1630 |
00002 | 10 | 6 | 100 | 10 | 1630 |
00002 | 10 | 7 | 100 | 10 | 1630 |
00002 | 10 | 8 | 100 | 10 | 1630 |
00002 | 10 | 9 | 100 | 10 | 1630 |
00002 | 10 | 10 | 100 | 10 | 1630 |
00002 | 10 | 1 | 100 | 10 | 1530 |
00002 | 10 | 2 | 100 | 10 | 1530 |
00002 | 10 | 3 | 100 | 10 | 1530 |
00002 | 10 | 4 | 100 | 10 | 1530 |
00002 | 10 | 5 | 100 | 10 | 1530 |
00002 | 10 | 6 | 100 | 10 | 1530 |
00002 | 10 | 7 | 100 | 10 | 1530 |
00002 | 10 | 8 | 100 | 10 | 1530 |
00002 | 10 | 9 | 100 | 10 | 1530 |
00002 | 10 | 10 | 100 | 10 | 1530 |