title: issues with joining query
body: <p>I am getting error in this query.
  I don't know what's wrong in it.
  Help will be appreciated.</p>
  
  <pre><code>SELECT Email, UserID, FirstName, LastName,
  count(*) as userTextCount FROM user LEFT JOIN posts ON posts.PostedAsId = user.UserID and
  PostedAs = 'USER' and PostType = 'text',
  count(*) as userMediaCount FROM user LEFT JOIN posts ON posts.PostedAsId = user.UserID and
  PostedAs = 'USER' and PostType = 'media'
  WHERE 1
  GROUP BY Email, UserID, FirstName, LastName
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>#1064 - You have an error in your SQL syntax; 
  MySQL server version for the right syntax to use near 'count(*) as userMediaCount FROM
  user LEFT JOIN posts ON posts.PostedAsId = user.' at line 3
  </code></pre>
  
  <p>User table contains: Email, UserId, FirstName, LastName and posts table contains all the posts and I need to count posts by specific user.</p>
  
  <p>Thanks.</p>