select * from table1 as a where exists( select * from table2 where field1=a.field1 and field2=a.field2 and field3=a.field3 and field4=a.field4 )
select * from table1 as a where not exists( /* ~~~*/ select * from table2 where field1=a.field1 and field2=a.field2 and field3=a.field3 and field4=a.field4 )
from table1 as a
where exists(
select *
from table2
where field1=a.field1 and field2=a.field2 and field3=a.field3 and field4=a.field4
)
from table1 as a
where not exists(
/* ~~~*/
select *
from table2
where field1=a.field1 and field2=a.field2 and field3=a.field3 and field4=a.field4
)
我现在就去试试!我以后一定好好谢你!