title: UNION All, Group BY and then get overall COUNT
body: <p>I have 2 Tables..</p>
  
  <p><strong>User 1</strong></p>
  
  <pre><code>user_id     mobile_no
     1          1111
     2          2222
  </code></pre>
  
  <p><strong>User 2</strong></p>
  
  <pre><code>user_id     mobile_no
     1          3333
     2          2222
  </code></pre>
  
  <p>I Want to first UNION These tables, then group by and then want to count total records </p>
  
  <p>I am using this query but it's not working </p>
  
  <pre><code>SELECT COUNT(Q2.total) AS Overall
  FROM (
     SELECT COUNT(Q.user_id) AS total
     FROM (
       SELECT * FROM user1
       UNION ALL 
       SELECT * FROM user2
     ) Q
    GROUP BY Q.mobile_no
  ) Q2
  </code></pre>
  
  <p>if i user Inner Query e-g:</p>
  
  <pre><code>   SELECT COUNT(Q.user_id) AS total
     FROM (
       SELECT * FROM user1
       UNION ALL 
       SELECT * FROM user2
     ) Q
    GROUP BY Q.mobile_no
  </code></pre>
  
  <p>I get these results, actually i want to again count these result...</p>
  
  <pre><code>total
   2
   1
   1
  </code></pre>
  
  <p>i expect this result</p>
  
  <pre><code>Overall
     3
  </code></pre>