title: MySQL three-table join
body: <p>I have three tables called <code>Clinic</code>, <code>Doctor</code>, and <code>Clinic_has_Doctor</code>. Suppose the two tables <code>Clinic</code> and <code>Doctor</code> have fields <code>id</code> and <code>name</code> as follows:</p>
  
  <pre><code>Clinic 
  +----+------------------------+
  | id | name                   |
  +----+------------------------+
  
  Doctor
  +----+------------------------+
  | id | name                   |
  +----+------------------------+
  </code></pre>
  
  <p>And <code>Clinic_has_Doctor</code> is a simple table containing mappings between clinics and doctors:</p>
  
  <pre><code>Clinic_has_Doctor
  +-----------+-----------------+
  | Clinic_id | Doctor_id       |
  +-----------+-----------------+
  </code></pre>
  
  <p>which expectedly are foreign keys to <code>Clinic</code> and <code>Doctor</code> IDs. I need to get the list of clinics and the doctors along them. So I would have a table like:</p>
  
  <pre><code>+-----------+--------------+------------+--------------+
  | Clinic_id | Clinic_name  | Doctor_id  | Doctor_name  |
  +-----------+--------------+------------+--------------+
  </code></pre>
  
  <p>I haven't done much <code>JOIN</code> SQL commands so I couldn't get out of this. Any help?</p>