Calculation On Table

  • I have 2 tables. The first Table as 6 millions records with particular product codes which have corresponding volume values attached to it.
    The second table has a list of product codes (about 6000) also with a value in another column attached to it.
    what i need to do is create a new version of table 1 where if any of the product codes in table 2 is found in table 1, the corresponding value for the product code found to match that in table 2 is divided by the value in table 2.
    e.g table 1 has a product code 123456 with a value of 36. table 2 also has a product code of 123456 but with a value of 12. therefore the new table 1 will have a product code of 123456 with a corresponding value of 36/12 = 3.