select t1.id, t1.value from t1 where t1.id in (select distinct t1.id from t1 join t2 on t1.id = t2.id) and t1.value not in (select value from t2);