title: MySQL Select multiple tables but return 1 row
body: <p>I have a database with multiple tables all tied by an ID. The tables would look something like:</p>
  
  <pre><code>TableA:
      user_id
      user_firstname
      user_lastname
  
  TableB:
      user_id
      exam_result
      date_taken
  </code></pre>
  
  <p>Table A will only ever contain a single row (unique User_ID) but Table B can contain multiple rows per User_ID. Something like this:</p>
  
  <pre><code>TableA:
      user_id = 1
      user_firstname = blah
      user_lastname = blah
  
      user_id = 2
      user_firstname = blah
      user_lastname = blah
  
  TableB:
      user_id = 1
      exam_result = F
      date_taken = somedate
  
      user_id = 1
      exam_result = E
      date_taken = somedate
  
      user_id = 1
      exam_result = U
      date_taken = somedate
  
      user_id = 2
      exam_result = A
      date_taken = somedate
  
      user_id = 2
      exam_result = A
      date_taken = somedate
  </code></pre>
  
  <p>My question is how can I get the data out of both tables but only ever return 1 row per unique ID... I think its called a Nested Select.</p>
  
  <p>If I could get the results to display something like:</p>
  
  <pre><code>user_id1, user_first_name1, user_lastname1, (F, somedate, E, somedate, U, somedate)
  user_id2, user_first_name2, user_lastname2, (A, somedate, A, somedate)
  </code></pre>
  
  <p>Hopefully it makes sense.</p>
  
  <p>Thanks in advance.</p>