Combining data from one table to another table at multiple levels

Table 1 has the following table.

Project| Resource Name | Line Manager
----------------------------------

2345    David          Peter
2345    Tam        Peter
2345    Richard        Peter
2358    Russell        Adam

      

Sheet2 Has the following table

Project| Month |Revenue
-----------------------

2345    Jan 10000
2345    Feb 15000
2358    Jan 8000
2358    Feb 12000

      

how to get the following result in sheet2

Project| Month| Revenue| Resource|Name Line Manager
------------------------------------------------

2345    Jan 10000   David   Peter
2345    Jan 10000   Tam Peter
2345    Jan 10000   Richard Peter
2345    Feb 15000   David   Peter
2345    Feb 15000   Tam Peter
2345    Feb 15000   Richard Peter
2358    Jan 8000    Russell Adam
2358    Feb 12000   Russell Adam

      

+3


source to share


1 answer


What about:



select s1.*, s2.* from sheet1 s1 join sheet2 s2 on s2.project=s1.project

      

+1


source







All Articles