title: How to aggregate and group by in each column?
body: <p>I have this table:</p>
  <pre><code>major minor
    A     a
    A     a
    A     b
    B     c
    B     d
  </code></pre>
  <p>I'd like to summarize <code>major</code> and <code>minor</code> columns to get this result:</p>
  <pre><code>major minor major_count minor_count
  A       a      3          2
  A       b      3          1             
  B       c      2          1
  B       d      2          1
  </code></pre>
  <p>Is there any way to achieve this? I tried:</p>
  <pre><code>select major, minor,count(major),count(minor)
  from table group by 1,2
  </code></pre>
  <p>But it didn't count each number.</p>