title: Having problems using UNION in a LEFT JOIN query
body: <p>I have the following joined query:</p>
  
  <pre><code>SELECT t1.*, t2.*
  FROM TabContent t1
  LEFT JOIN HighScore t2
    ON t1.Name = t2.Layout
  WHERE TabID IN (1,2,3)
  ORDER BY TabID, LayoutName
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  |TabConID|  Name  | Tiles  | Layers | TabID  |Score ID|  fbID  | Layout |  Score |  Time  |  Stars |  Date  |
  +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  | 1      | beetle |   30   |    5   |   1    |   1    |  2222  | beetle |  293   |  13:00 |   1    |  date  |
  | 2      |elephant|   31   |    4   |   1    |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |
  | 3      | dragon |   31   |    5   |   2    |   2    |  3333  | dragon |  232   |  08:35 |   2    |  date  |
  +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  </code></pre>
  
  <p>Now I want to show all Names (and the data that comes with it) that fbID 2222 owns. I did that like this:</p>
  
  <pre><code>SELECT t1.*, t2.* FROM TabContent t1 LEFT JOIN HighScore t2 ON t1.Name = t2.Layout WHERE fbID = 2222 AND TabID IN (1,2,3) ORDER BY TabID, LayoutName
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  |TabConID|  Name  | Tiles  | Layers | TabID  |Score ID|  fbID  | Layout |  Score |  Time  |  Stars |  Date  |
  +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  | 1      | beetle |   30   |    5   |   1    |   1    |  2222  | beetle |  293   |  13:00 |   1    |  date  |
  +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  </code></pre>
  
  <p>So far so good! The thing is, there are more Names (elephant, dragon). I want to show these too, but leave the data (accept the TabConID, Name, Tiles, Layers, TabID) blank.</p>
  
  <p><strong>This is the result I need:</strong></p>
  
  <pre><code>+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  |TabConID|  Name  | Tiles  | Layers | TabID  |Score ID|  fbID  | Layout |  Score |  Time  |  Stars |  Date  |
  +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  | 1      | beetle |   30   |    5   |   1    |   1    |  2222  | beetle |  293   |  13:00 |   1    |  date  |
  | 2      |elephant|   31   |    4   |   1    |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |
  | 3      | dragon |   31   |    5   |   2    |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |  NULL  |
  +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
  </code></pre>
  
  <p>The best way to do this is with UNION. If this was a normal Query and not a joined one, the query would look something like this (this is a non join example, that I am not using, but to explain things):</p>
  
  <pre><code>SELECT * FROM `table` WHERE fdID = 2222 AND TabID IN (1,2,3) ORDER BY TabID, LayoutName
  UNION 
  select TabConID, Name, Tiles, Layers, TabID, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM `table` where fbID != 2222
  </code></pre>
  
  <p>Unfortunately this is a joined query and I have no idea how to make the UNION part work with this. Also searched using Google but had no luck.</p>
  
  <p>Hope someone can help!</p>