I have two tables. The columns i am interested in table 1 is "Year" and "CompanyName". Table 2 has 3 columns including: "Year" and "CompanyName".
How can I join these two tables together? The problem I have is that table 1 has many columns that have for example the year value as "Year" = "2004" and "CompanyName" = "Adidas". e.g.
# There are many other columns
Year CompanyName Spent
1 2004 Adidas 50
2 2004 Nike 34
3 2004 Adidas 45
4 2005 Reebok 33
5 2006 Reebok 11
6 2006 Adidas 47
7 2007 Nike 33
8 2007 Reebok 92
9 2007 Nike 01
10 2007 Adidas 23
#I want to join this to it
Year CompanyName Loss
1 2004 Nike 23
2 2004 Adidas 22
3 2005 Reebok 633
4 2006 Reebok 2
5 2006 Adidas 09
6 2007 Reebok 22
7 2007 Nike 34
I want to join the tables so when ever Year is 2004 and CompanyName is Adidas a column is added for Loss with the value 23
Thank You!