$a = $modx->newQuery({'table1','table2'});
$a->where(array('id' => 3,));
$results = $modx->getCollection({'table1','table2'},$a);
etc...
$stmt = $modx->query('
SELECT *
FROM table1 t1
WHERE t1.id = 3
UNION ALL
SELECT *
FROM table2 t2
WHERE t2.id = 3
');
if ($stmt) {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$output .= $modx->getChunk($tpl,$row);
}
return $output;
}