Hello good people. I really need your help. I'm stuck with 3 tables each with over 200,000 rows. They need to be combined in one table. I honestly don't know how to explain it so i tried my best with attachment (please view 1.jpg)
(for some reason i can't upload image here, it says there is some mistake, so here it is http://postimg.org/image/dnbtmihqh/ )
To oversimplify it:
i have a code (text value not number) of a product and number of times it has been bought and sold per year
Lets say we have three tables
TABLE 1
Code----Product----2012 sold----2012 bought
br01-----name--------13 ----------- 25
TABLE 2
Code---Product---2013 sold----2013 bought
br01---- name ------2-------------1
TABLE 3
Code--Product---2014 sold---2014 bought
br01---name-------9------------2
What i need is this three tables combined into one:
Code---Product---2012 sold---2012 bought----2013 sold----2013 bought---2014 sold----2014 bought
br01----name-------13-----------25------------ 2 -------------1-----------9--------------2
the problem is not all products have been bought and sold in all three years. some were bought and sold only in one year, other in two years and some in all three years. Good thing is if a products was bought in 2012 it was also sold in 2012. In other words if a product was bought it was also sold in a same year. So for some products table can look like this
Code--Product--2012 sold--2012 bought--2013 sold--2013 bought--2014 sold--2014 bought
br04---name--------------------------------4----------11
Finally, those two products in one table:
Code---Product---2012 sold---2012 bought----2013 sold----2013 bought---2014 sold----2014 bought
br01----name-------13-----------25------------ 2 -------------1-----------9--------------2
br04----name-----------------------------------4-------------11
Please view picture i post in attachment it will be much clearer (i hope). I would greatly appriciate your help. The only other way to do this is the long long long road of filling those cells manually. and that equals suicide (kidding. mostly)
Thank you so much for even reading this madness
Best wishes
Thomas
Bookmarks