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