Je to to, co chcete?
select e.*
from egr e
where not exists (select 1
from egr e2
where e2.groupid = e.groupid and e2.offid <> e.offid
);
Nebo pokud se chcete omezit pouze na tyto dvě nabídky:
select e.*
from egr e
where e.offid in (1, 2) and
not exists (select 1
from egr e2
where e2.groupid = e.groupid and
e2.offid in (1, 2) and
e2.offid <> e.offid
);