title: How to do a double select statement in one query SQL
body: <p>It is possible to do a double select statement into one query, and this show each value individually, using <code>sum</code> and <code>suma</code> for the first select I'm expecting only one value, and for the second one 4 values.</p>
  
  <pre><code>echo ' ' . htmlentities($rowsm['sum'], ENT_QUOTES, 'UTF-8') . '&lt;br&gt;'; 
  $query = "SELECT SUM(a.totalpoints) as sum
            FROM total as a
            WHERE a.id = '$id'
            GROUP BY a.id
            UNION ALL
  
  SELECT SUM(s.points) as suma
         FROM points as s 
         GROUP BY s.id
  </code></pre>
  
  <p>This is the output I'm getting</p>
  
  <pre><code>A 21 first select
  A 11 second select
  A 10 second select
  A 9 second select
  A 14 second select
  </code></pre>
  
  <p>21 Total sum</p>
  
  <pre><code>A 11 points
  A 10 points
  A 9 points
  A 14 points
  </code></pre>