title: Need to do a MySQL OUTER JOIN
body: <p>I have a MYSQL query that works just right except that I want to perform an OUTER join on two statements so that they display rows of the first table that does not need to have corresponding rows in the second table. The Query is as follows</p>
  <pre><code>SELECT wp_usermeta.user_id,
                      m9.id as group_id,
                      wp_usermeta.meta_value as nickname,
                      m2.meta_value as abbreviation,
                      m3.meta_value as name,
                      m4.meta_value as games,
                      m5.description as description,
                      m6.slug as slug,
                      m7.date_created as date_created,
                      m8.meta_value as total_member_count,
                      m10.status as status,
                      m11.membership_id as type
              FROM wp_usermeta 
              INNER JOIN wp_usermeta as m2 ON wp_usermeta.user_id = m2.user_id
              INNER JOIN wp_usermeta as m3 ON wp_usermeta.user_id = m3.user_id
              INNER JOIN wp_usermeta as m4 ON wp_usermeta.user_id = m4.user_id
              INNER JOIN wp_bp_groups as m5 ON wp_usermeta.user_id = m5.creator_id
              INNER JOIN wp_bp_groups as m6 ON wp_usermeta.user_id = m6.creator_id
              INNER JOIN wp_bp_groups as m7 ON wp_usermeta.user_id = m7.creator_id
              INNER JOIN wp_bp_groups as m9 ON wp_usermeta.user_id = m9.creator_id
              INNER JOIN wp_bp_groups_groupmeta as m8 ON m9.id = m8.group_id
            #  INNER JOIN wp_2_pmpro_memberships_users as m10 ON wp_usermeta.user_id = m10.user_id
            #  INNER JOIN wp_2_pmpro_memberships_users as m11 on wp_usermeta.user_id = m11.user_id
              WHERE (wp_usermeta.meta_key = 'nickname' AND 
                      m2.meta_key = 'abbreviation' AND
                      m3.meta_key = 'name' AND
                      m4.meta_key = 'games' AND
                      m8.meta_key = 'total_member_count' AND
                      m10.status  = 'active' AND
                      m11.status  = 'active'
                      )
  </code></pre>
  <p>According to <a href="https://stackoverflow.com/questions/4796872/full-outer-join-in-mysql">this</a> SO thread I have tried to use the format</p>
  <pre><code>SELECT * FROM t1 
  LEFT JOIN t2 ON t1.id = t2.id 
  UNION 
  SELECT * FROM t1 
  RIGHT JOIN t2 ON t1.id = t2.id
  </code></pre>
  <p>to change the two lines marked with a # above to</p>
  <pre><code>            INNER JOIN (
                      SELECT * FROM wp_usermeta
                      LEFT JOIN wp_2_pmpro_memberships_users ON wp_usermeta.user_id = wp_2_pmpro_memberships_users.user_id
                      UNION
                      SELECT * FROM wp_usermeta
                      RIGHT JOIN wp_2_pmpro_memberships_users ON wp_usermeta.user_id = wp_2_pmpro_memberships_users.user_id
                  )
  </code></pre>
  <p>But it doesn't seem to work. MySQL throws an error</p>
  <h1>1248 - Every derived table must have its own alias</h1>
  <p>My SQL Query knowledge is Basic and limited to simple DB Queries. Any help would be appreciated.</p>