title: How to populate a table in SQL
body: <p>In table 1 of my database is a column called Product Title, some of the products have the same name. However, they have different prices.</p>
  
  <p>There is also a column called Product Version. This could be filled with Sale Price, Master Retail Price, Black Friday Price.</p>
  
  <p>For all of the the products that are not 'Master Retail Price', I need to populate the Master Retail Price product number in to the Main Product Number Column.</p>
  
  <p>So for example: If there are three Items called Banana, I need the ones that are the sale versions to have the Main Product Number in the Main Product Number Column.</p>
  
  <p>If the Product Version is 'Master Retail Price', then Main Product Number should be NULL for that row.</p>
  
  <p>So far, the code I have inserts all the product numbers from table 1 into table 2. If anyone could help here I would greatly appreciate it.</p>
  
  <pre><code>Select [Table 1].[Product Title], [Table 1].[Product No]
  
  FROM [Table 1] 
  
  INNER JOIN [Table 2] ON [Table1].[Product Title]=[Table 2].[Product Title]
  
  UPDATE [Table 1] 
  
  SET [Table 1].[Main Product Number]=[Table1.[Product No] 
  
  WHERE [Table 1].[Product Verison]='Master Retail Price';
  </code></pre>