原则上不允许使用"exsits"和"not exists"查询,应转换成相应的"等连接"和外连接来查询
错误的写法:
select a.id
from company a
where not exsits (select 1 from av_info_new b where a.id = b.company_id)
正确的写法:
select a.id
from company a, av_info_draft b
where a.id = b.company_id
and b.company_id is null
错误的写法:
select count
from company a
where exsits (select 1 from av_info_new b where a.id = b.company_id)
正确的写法:
select count from company a, av_info_draft b where a.id = b.company_id