How to write union sql query using db_select() in drupal7 with these conditions
The UNION, of course, is the sticker in this situation. I believe that this post best addresses the issue. Aside from that, I'm not sure how well supported the integration of the other parts will be.
Drupal is a registered trademark of Dries Buytaert.