用exists,exists是基本语句:select * from table1 a
where exists (select 1 from table2 where ... and id1=a. id1 and id2=a.id2)
where exists (select 1 from table2 where ... and id1=a. id1 and id2=a.id2)
IN (select cast(id1 as varchar)+cast( id2 as varchar)from table2 where ...)