title: SQL : Obtaining groups and counts at the same time
body: <p>Suppose my table looks like this:</p>
  
  <pre><code>Name City Salary
  n1   c1   10
  n1   c1   20
  n1   c1   30
  n2   c2   20
  n2   c2   50
  n3   c2   70
  </code></pre>
  
  <p>And I am interested in the following output:</p>
  
  <pre><code>Name Count 
  n1   3 
  n2   2  
  n3   1
  </code></pre>
  
  <p>I am fairly new to SQL and have been doing similar commands in SAS (e.g. in this case I would have used PROC FREQ) - but I am now required to write the same code only in the SQL language (I am using Aginity Netezza). All help is appreciated.</p>