title: Column is not contained in either an aggregate function or the GROUP BY clause
body: <p>I have to tables:
  <code>DeviceInstace</code> and <code>Device</code></p>
  
  <p>They are connected with <code>Foreign Key</code> on <code>DeviceInstance.DeviceId=Device.Id</code></p>
  
  <p>I have SQL query:</p>
  
  <pre><code>select d.CatalogNo,d.Manufacturer,d.Name, sum(quantity) 
  from DeviceInstance di 
  full join Device d 
  on d.Id=di.DeviceId 
  group by di.DeviceId
  </code></pre>
  
  <p>with which I need to make little summary that consist of:</p>
  
  <ul>
  <li>catalog number</li>
  <li>manufacturer</li>
  <li>device name</li>
  <li>number of devices (sum of values in quntity columns for these deviceIds)</li>
  </ul>
  
  <p>But I'm facing some <code>Grouping by</code> issuses. </p>
  
  <p>All I try refuse me error like this one:</p>
  
  <pre><code>Column 'Device.CatalogNo' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
  </code></pre>
  
  <p>I know I can group by <code>CatalogNo</code> but then ten sum of quantity will return wrong numbers. </p>
  
  <p>Can anyone suggest me how to repair it?</p>