title: Mysql LEFT Join query only returns one row when adding Count() mysql function
body: <p>I have this mysql query (evolving <strong>two tables</strong>: <code>Users</code> and <code>Files</code>) that's giving me headaches:</p>
  
  <pre><code>SELECT Users.GUID, Users.Name, Users.CreationDate, Files.Date, 
      Count(Files.GUID) As FilesCount
  FROM Users
  
      LEFT JOIN Files ON Users.GUID = Files.UserGUID
  
  WHERE Users.Group =  '1'
  </code></pre>
  
  <p>When I execute it, it <strong>always</strong> return 1 row (which is not what I want). But if I remove this:</p>
  
  <pre><code>Count(Files.Date) As FilesCount
  </code></pre>
  
  <p>It correctly return all the rows that I expect.</p>
  
  <p><strong>I basically need to get the number of files that belongs to a user</strong> (along with the user info)</p>
  
  <p><strong>My question is:</strong> How can I fix this &amp; make the mysql query return the user basic info along with the files count?</p>
  
  <p>BTW, I'm using CodeIgniter 2 with PHP 5 (although I don't think it matters here...)</p>