title: GROUP_CONCAT on multiple tables in one query
body: <p>I'm working on a polling site, wherein the basic information for each poll is stored in one table, the choices are stored in another, and the votes are stored in yet another. This structure gives me the most flexibility but, because I'm not a mySQL expert, I'm having some trouble with the query to retrieve all the relevant data at once.</p>
  
  <p>So far, I've been able to use GROUP_CONCAT to select the choices as a CSV, but with the current structure, I'm not sure how to use GROUP_CONCAT again to also grab a list of votes. The query I'm using so far looks like this: </p>
  
  <pre><code>SELECT polls.id AS id, polls.name AS name, polls.time AS time, polls.description AS description, ch.choices 
  FROM (SELECT poll, GROUP_CONCAT(name) AS choices FROM choices GROUP BY poll) AS ch 
  JOIN polls ON ch.poll = polls.id 
  ORDER BY polls.time DESC 
  LIMIT 0, ' . ($count - 1)
  </code></pre>
  
  <p>Relevant columns in the votes table are 'poll', and 'vote', where poll is the same as polls.id and vote corresponds with choice.id. Specifics aside though, all I really need to know is how to use GROUP_CONCAT to retrieve values from two tables, instead of just one, in a single query. I would appreciate any input. Thanks!</p>