title: How do we select multiple columns in a sum()/group by query?
body: <p>I have a requirement to pull a total # of product quantity from an Access DB, but include the vendor name, id number, description, etc... along with the sum of quantity.</p>
  
  <p>I have a query like this:</p>
  
  <pre><code>SELECT [Vendor Name], SUM([Quantity]) AS Total
  FROM [SalesDB]
  WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts'
  Group By [Vendor Name]
  </code></pre>
  
  <p>Works great... except I need to pull more columns in the query, something like this:</p>
  
  <pre><code>SELECT [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity],  SUM([Quantity]) AS Total
  FROM [SalesDB]
  WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts'
  Group By [Vendor Name]
  </code></pre>
  
  <p>Doesn't work, throws an aggregate error</p>
  
  <p>So instead do something like so:</p>
  
  <pre><code>SELECT [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity],  SUM([Quantity]) AS Total
  FROM [SalesDB]
  WHERE [Vendor No] IN (1,2,3,4,5,6,7,8) AND [Item Description] = 'bolts'
  Group By [Vendor Name], [Vendor No], [Item No], [Item Description], [Item Cost], [Quantity]
  </code></pre>
  
  <p>Which runs but changes the results too much. What's the appropriate way to handle this query?</p>