C++ (Qt)
query.exec(" SELECT nmedk, fam, im, otch, datr, datp, datw, diagn"
" FROM st_ps_00"
" WHERE fam = ? AND im = ? otch = ?"
" UNION ALL"
" SELECT nmedk, fam, im, otch, datr, datp, datw, diagn"
" FROM st_ps_99"
" WHERE fam = ? AND im = ? otch = ?");
query.addBindValue(....);
.....
query.exec();