title: SQL: insert total count row after joining table
body: <p>The first step is to join <code>staff</code> and <code>customer</code> together. The second step is to count the distinct product_id. My target is to add the total(sum) field under the result table.
  Thanks.</p>
  <p><code>staff</code></p>
  <pre><code>staff_ID     Name     cust_id          
  1            Tom       101   
  1            Tom       101
  1            Tom       105
  2            Peter     102
  2            Peter     104
  3            Billy     103    
  </code></pre>
  <p><code>customer</code></p>
  <pre><code>cust_id    product_id        
  101             A1
  102             A2
  103             A3
  104             A4
  105             A5
  </code></pre>
  <p>My work:</p>
  <pre><code>SELECT a.staff_name,COUNT(DISTINCT a.product_id)
  FROM (SELECT distinct a.staff_id, a.staff_name, a.cust_id
       FROM staff)a
  LEFT JOIN customer b ON a.cust_id=b.cust_id
  GROUPBY a.staff_name
  </code></pre>
  <p>What I want is to add the <strong>total</strong> column below the count.</p>
  <pre><code>Name     count         
  Tom       2   
  Peter     2
  Billy     1
  Total     5  
  </code></pre>