title: SQL Server group by absorb null and empty values
body: <p>I have this data:</p>
  
  <pre><code>Id  Name     amount    Comments 
  -------------------------------
  1     n1     421762    Hello    
  2     n2        421    Bye      
  3     n2        262    null     
  4     n2       5127    ''  
  </code></pre>
  
  <p>Each name may or may not have extra rows with null or empty comments.</p>
  
  <p>How can I group by name and sum(amount) such that it ignores/absorbs the null or empty comments in the grouping and shows me only 2 groups.</p>
  
  <p>Output I want:</p>
  
  <pre><code>Id   Name     sum(amount)   Comments 
  ------------------------------------
  1     n1         421762     Hello    
  2     n2           5180     Bye 
  </code></pre>
  
  <p>I can't figure this out.  </p>
  
  <p>I hoped that would ignore the null/empty values but I always end up with 4 groups</p>
  
  <pre><code>select id, name, sum(amount), comments 
  from table 
  group by id, name, comments
  </code></pre>