title: Alasql: UNION (or UNION ALL) only gives results from table1
body: <p>When using UNION or UNION ALL in a GROUP BY query using alasql (<a href="https://github.com/agershun/alasql" rel="nofollow">https://github.com/agershun/alasql</a>), only results from table1 are retrieved.</p>
  
  <p>Running separate queries outputs correct results instead.</p>
  
  <p>See this jfiddle <a href="http://jsfiddle.net/L8471bnk/116/" rel="nofollow">http://jsfiddle.net/L8471bnk/116/</a></p>
  
  <pre><code>var data= [
  {"label":"transport - car","value":800},
  {"label":"airplane","value":234},
  {"label":"train","value":500},
  {"label":"glider","value":123},
  {"label":"transport - motorbike","value":50},
  {"label":"transport - bike","value":150}
  ];
  
  
  var query1 = alasql('' +
          'SELECT \'transport\' AS label, SUM(CAST([value] AS INT)) AS [value] ' +
          'FROM ? ' +
          'WHERE label LIKE \'%transport%\' ' +
          'GROUP BY \'transport\' ' +
          '',
  [data]);
  
   var query2 = alasql('' +
          'SELECT label, SUM(CAST([value] AS INT)) AS [value] ' +
          'FROM ? ' +
          'WHERE label NOT LIKE \'%transport%\' ' +
          'GROUP BY label' +
          '',
  [data]);
  
  var queryUnion = alasql('' +
          'SELECT \'transport\' AS label, SUM(CAST([value] AS INT)) AS [value] ' +
          'FROM ? ' +
          'WHERE label LIKE \'%transport%\' ' +
          'GROUP BY \'transport\' ' +
          'UNION ALL ' + //or UNION, same result!
          'SELECT label, SUM(CAST([value] AS INT)) AS [value] ' +
          'FROM ? ' +
          'WHERE label NOT LIKE \'%transport%\' ' +
          'GROUP BY label' +
          '',
  [data, data]);
  
  
  $("#res").html("&lt;br/&gt;UNION IS WRONG (length is correct, but query2 results are missing!!!)!&lt;br/&gt;" + JSON.stringify(queryUnion) + " LENGTH: " + queryUnion.length);
  
  $("#info").html("&lt;br/&gt;Query1 is correct:&lt;br/&gt;" 
  + JSON.stringify(query1) 
  + " LENGTH: " + query1.length
  + "&lt;br/&gt;&lt;br/&gt;Query2 is correct&lt;br/&gt;" + JSON.stringify(query2) 
  + " LENGTH: " + query2.length);
  </code></pre>