How to create a union of two views?
Here's a working and tested example:

/**
 * Implements hook_views_pre_execute().
 */
function mymodule_views_pre_execute(view &amp;$view) {
  if ($view-&gt;name == 'my_view') {
    $query1 = &amp;$view-&gt;build_info['query'];

    // Basic setup of the second query.
    $query2 = db_select('another_table', 'at')
      -&gt;condition('some_field', 0, '&gt;')
      -&gt;condition('some_other_field', 12345);

    // The number of fields (and their aliases) must match query1.
    // Get the details with:
    // dpm($query1-&gt;getFields());
    $query2-&gt;addField('at', 'some_field', 'alias1');
    $query2-&gt;addField('at', 'some_other_field', 'alias2');
    $query2-&gt;addField('at', 'some_other_field2', 'alias3');
    $query2-&gt;addField('at', 'some_other_field3', 'alias4');

    // Verify that queries are very similar.
    // dpq($query1);
    // dpq($query2);

    // Matrimony.
    $query1 = $query2-&gt;union($query1, 'UNION ALL');

    // Manual test.
    // dpm($query1-&gt;execute()-&gt;fetchAll());

  }
}


This works for most views.  However some style plugins may do fancy stuff that won't work with this technique (Calendar module I'm looking at you).