title: SQL request LEFT JOIN
body: <p>Let's say I have these table:
  What should be my sql request to get the expected result?</p>
  
  <p>table user_group:</p>
  
  <pre><code>group_id          |   user_id       |   is_active
  1                          2               1
  1                          3               1
  2                          2               1
  4                          2               1
  </code></pre>
  
  <p>table group : </p>
  
  <pre><code>id |     name
  1       group1
  2       group2
  3       group3
  4       group4
  5       group5
  6       group5
  </code></pre>
  
  <p>expected result</p>
  
  <pre><code>group_id       |      name      | user_id    |   is_active
   1                   group1         2               1
   2                   group2         2               1
   3                   group3         2               0
   4                   group4         2               1
   5                   group5         2               0
   6                   group6         2               0
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>SELECT g.id, g.name, ug.user_id, ug.is_active
  FROM group g
  LEFT OUTER JOIN user_group uc ON ug.group_id = g.id
  WHERE ug.user_id =2
  </code></pre>
  
  <p>but I only have the groups where user 2 is IN (so group1, group2 and group4)</p>