SELECT a.policyno, a.agentcode, b.agentname FROM prpcmain a, prpdagent b WHERE a.agentcode = b.agentcode(); 相当于: SELECT a.policyno, a.agentcode, b.agentname FROM prpcmain a LEFT JOIN prpdagent b ON a.agentcode = b.agentcode; 表示左关联
SELECT a.policyno, a.agentcode, b.agentname FROM prpcmain a, prpdagent b
WHERE a.agentcode = b.agentcode(+);
相当于:
SELECT a.policyno, a.agentcode, b.agentname FROM prpcmain a
LEFT JOIN prpdagent b
ON a.agentcode = b.agentcode;
表示左关联,即左边表中的数据都有,是以左边表为基础的。