title: MySQL: Creating Multiple Variables with COALESCE
body: <p>By using COALESCE, I can create a temporary variable called comment_votes like so:</p>
  
  <pre><code>SELECT comments.*, COALESCE(rs_reputations.value, 0) AS comment_votes FROM `comments` 
  LEFT JOIN rs_reputations ON comments.id = rs_reputations.target_id AND 
  rs_reputations.target_type = 'Comment' AND rs_reputations.reputation_name = 
  'comment_votes' AND rs_reputations.active = 1 WHERE (impression_id = 1)
  </code></pre>
  
  <p>I want to create a second variable called impression_votes in the came query. I attempted to do this with:</p>
  
  <pre><code>SELECT comments.*, COALESCE(rs_reputations.value, 0) AS comment_votes 
  FROM 'comments' 
      LEFT JOIN rs_reputations ON 
          comments.id = rs_reputations.target_id AND 
          rs_reputations.target_type = 'Comment' AND 
          rs_reputations.reputation_name = 'comment_votes' AND 
          rs_reputations.active = 1 
  SELECT comments.*, COALESCE(rs_reputations.value, 0) AS impression_votes 
  FROM 'comments' 
      LEFT JOIN rs_reputations ON 
      comments.id = rs_reputations.target_id AND
      rs_reputations.target_type = 'Comment' AND
      rs_reputations.reputation_name = 'impression_votes' AND 
      rs_reputations.active = 1 
  WHERE
  </code></pre>
  
  <p>This leads to the error:</p>
  
  <pre><code>You have an error in your SQL syntax
  </code></pre>
  
  <p>Is what I'm attempting even possible? If so, I seem to be bridging the two SELECT/COALESCE statements improperly. How should I write this?</p>