title: Is there an SQL function to add total units of products surfacing in data multiple times
body: <p>I am cutting down some data to make it easier to read, it was entered by every transaction, however I need to have just one row per product code instead of multiple (sums, of units sold and total pounds). How can I do this so I do not have 600,000 rows and only 2,500 products codes. </p>
  
  <pre><code>select [master code], [product code], [units sold]
    , [product weight] * [units sold] as 'Total Lbs per Product'
  from [dbo].[sales_data_outgoing_master]
  where [ship year] = 2019
  order by [family code]
  </code></pre>
  
  <p>I am getting an answer like the top table in the photo, and would like a table like the lower. Is there code to do this in SQL?</p>
  
  <p><img src="https://i.stack.imgur.com/3dj9C.png" alt="ME tables depicting issue"></p>