title: SQL - Is there a way to hide a column from a select?
body: <p>i made a query that shows the result i want (close enough)... but it's not perfect as should be.</p>
  
  <p>I'm counting the number of registers per user..</p>
  
  <p>The SQL:</p>
  
  <pre><code>SELECT us.name, _reg FROM tb_user AS us
  LEFT JOIN tb_register as rg ON rg.iduser = us.iduser
  INNER JOIN
      (select rg.iduser, count(*)
          FROM tb_register AS rg    
          group by rg.iduser)
  AS _reg ON rg.iduser = _reg.iduser
  
  GROUP BY us.name, _reg
  </code></pre>
  
  <p>The result i get is something like...</p>
  
  <pre><code>+-----------+-----------------+
  | name      | _reg            |
  +-----------+-----------------+
  | example_A | (id_A, count_A) |
  +-----------+-----------------+
  | example_B | (id_B, count_B) |
  +-----------+-----------------+
  </code></pre>
  
  <p>But what i really want is just name and the row count..
  I'm using in the subquery "rg.iduser" to reference in this INNER JOIN, but because of that, i get the "iduser" in the result.</p>
  
  <p><b>Is there a better way to do that to show what i want.. or a way to hide the "iduser" in the result of this query?</b></p>
  
  <p>Thanks..</p>