..

    query.exec(QString("SELECT scientists.* FROM scientists INNER JOIN
Joined j on (%1) = j.s_ID union all SELECT Computers.* FROM Computers
INNER JOIN Joined j on Computers.ID = j.c_ID")
                        .arg(sID));