title: Merge values into single rows grouped by item id
body: <p>I have a working SQL query that gets me the values I need like so:</p>
  <pre><code>SELECT [dev_Inventory].[dbo].[IV00102].[ITEMNMBR],
  [dev_Inventory].[dbo].[CCIVtblExtenderData].[WheelName], 
  [dev_Inventory].[dbo].[CCIVtblExtenderData].[FinishDesc],
  &quot;Qty on Hand&quot; = [dev_Inventory].[dbo].[IV00102].[QTYONHND],
  &quot;Qty in Transit&quot; =  
  CASE 
     WHEN [dev_Inventory].[dbo].[IV00102].[LOCNCODE] LIKE 'IT-%'  THEN [dev_Inventory].[dbo].[IV00102].[QTYONHND]
     ELSE 0
  END,
  &quot;Qty in Production&quot; = [dev_Inventory].[dbo].[IV00102].[QTYONORD]
  FROM [dev_Inventory].[dbo].[CCIVtblExtenderData]
  INNER JOIN [dev_Inventory].[dbo].[IV00102] ON [dev_Inventory].[dbo].[CCIVtblExtenderData].[VendPartNmbr] = [ITEMNMBR];
  </code></pre>
  <p>The issue I am having is that I have a lot of duplicates with the same itemnumber and I would like to merge those values along with the quantities as well.</p>
  <p>Here is an example of the output that I need to fix:
  <a href="https://i.stack.imgur.com/HVsUy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HVsUy.png" alt="enter image description here" /></a></p>
  <p>So in this scenario this should output a single row:</p>
  <pre><code>1780CHS105127G71 - CHASE - Brushed Gunmetal - 32 - 0 - 0
  </code></pre>
  <p>I realize this may be a fairly simple sql query fix for some and I know I need to sum the QTY fields, but any suggestions on a clean approach using the existing query would be much appreciated</p>