exists(select * from A inner join B on A.Bid=B.Id inner join C on A.Code=C.Code where B.Name='hello')
select count(*) from B where B.Name='hello' and exists(select 1 from A where B.Id=A.BId and (A.Code='a' or A.Code='b'))
谢谢,如果Code是在一张表里,比如C表,该怎么写?