更正:
select distinct a1 from t1 a where
not exists
(select b2 from t2 minus select b1 from t1 where a1 = a.a1)
and not exists
(select b1 from t1 where a1 = a.a1 minus select b2 from t2 )
select a1
from (select distinct a1 from t1) as ta
where (select count(*) from t1 where a1=ta.a1)
= (select count(*) from t1,t2 where t1.b1=t2.b2 and t1.a1=ta.a1)
if (select count(*) from t1,t2 where t2.b2=t1.b1)=(select count(*) from t2)
begin
if (select count(*) from (select a1 from t1,t2 where t2.b2=t1.b1 group by t1.a1) test)=1
begin
print '满足条件 '
select distinct a1 from t1,t2 where t2.b2=t1.b1
end
else
print '不满足条件 '
end