select * from ac01 where aac003 like '%£¨%' and not exists (select 1 from ac06 where ac01.aac001=ac06.aac001 and ac06.aac071=‘行业’)
select * from ac01 where aac003 like '%£¨%' and not exists (select * from ac06 where ac01.aac001=ac06.aac001 and ac06.aac071=‘行业’)
select * from ac01 where aac003 like '%£¨%' AND not exists ( select * from ac06 where ac01.aac001=ac06.aac001 and ac06.aac071=‘行业’) 或者 select * from ac01 where aac003 like '%£¨%' AND not in( select aac001 from ac06 where ac06.aac071=‘行业’)
不要用in.效率太低 select * from ac01 where aac003 like '%£¨%' and not exists (select ac01.* from ac01,ac06 where ac01.aac001=ac06.aac001 and ac06.aac071=‘行业’)
and not exists (select 1 from ac06 where ac01.aac001=ac06.aac001 and ac06.aac071=‘行业’)
and not exists
(select * from ac06 where ac01.aac001=ac06.aac001 and ac06.aac071=‘行业’)
where aac003 like '%£¨%'
AND not exists (
select * from ac06 where ac01.aac001=ac06.aac001 and ac06.aac071=‘行业’)
或者
select * from ac01
where aac003 like '%£¨%'
AND not in(
select aac001 from ac06 where ac06.aac071=‘行业’)
select * from ac01 where aac003 like '%£¨%'
and
not exists
(select ac01.* from ac01,ac06 where ac01.aac001=ac06.aac001 and ac06.aac071=‘行业’)