title: MySQL, join many to many relationship query
body: <p>I have this query:</p>
  
  <pre><code>SELECT
      GROUP_CONCAT(DISTINCT
          `persons`.`name`,
          '[START_Name_END]',
          `persons`.`id`,
          '[START_Id_END]',
          `persons`.`isteacher`,
          '[START_IsTeacher_END]'
      SEPARATOR '[START_ROWSEPERATOR_END]') AS persons_values,
      `locations`.`name` AS locations_name,
      `locations`.`id` AS locations_id
  FROM `locations`
  INNER JOIN `locations_persons` ON `locations_persons`.`location_id` = `locations`.`id`
  INNER JOIN `persons` ON `persons`.`id` = `locations_persons`.`person_id`  
  GROUP BY `locations`.`id`
  ORDER BY `locations`.`id`
  </code></pre>
  
  <p>The reason why I use <code>GROUP_CONCAT</code> is to get all rows from <code>persons</code> table, that have reference in the association table, in the same column</p>
  
  <p>I use  <code>[START_Name_END], [START_Id_END]</code> to split the result later in my code and <code>[START_ROWSEPERATOR_END]</code> to determine if it's same row or a new one.</p>
  
  <p>Everything works just fine so far. </p>
  
  <p>The thing is if any row in <code>locations</code> table has no reference to any row in <code>persons</code> table, I'm NOT getting that row in the results!</p>
  
  <p>I beleive that the problem is in <code>JOIN</code>, what should I use to fetch all rows regardless if that row has reference in the association table or not?</p>
  
  <p>Any help would be greatly appreciated!</p>