错误:
select policyno,itemkindno from tmp_policy_prp where
(policyno,itemkindno) not in (select policyno,itemkindno from tmp_policy_stat)
正确,但是效率不高:
select policyno,itemkindno from tmp_policy_prp t1 where not exists
(select 1 from tmp_policy_stat t2
where t1.policyno=t2.policyno
and t1.itemkindno=t2.itemkindno)
请问in能用多个字段去关联子查询吗
------解决方案--------------------
多字段的没法用 in。
看看有木有reference,index