FROM tab1 a,
tab2 l,
tab3 cp,
tab4 jic,
tab5 c
WHERE a.member_number = l.member_number
AND l.challenge_phrase = cp.challenge_phrase_id(+)
AND IFNULL(a.join_ip_address, a.update_ip_address) = jic.join_ip_address(+)
AND IFNULL(jic.country_code, '-') = c.iso_code(+)
AND l.login NOT LIKE 'jfaux%'
AND a.join_date >= SYSDATE - 14;
如何将此代码转换为左外连接的mysql格式?
答案 0 :(得分:0)
ORACLE LEFT(或RIGHT)JOIN完整语法相当于MySQL(除了MySQL中没有FULL OUTER JOIN
):
<强> ORACLE 强>:
SELECT a.field, b.field
FROM tableA a LEFT JOIN tableB b on (a.id = b.id)
也
SELECT a.field, b.field
FROM tableA a, tableB b
WHERE a.id = b.id (+)
<强>的MySQL 强>:
SELECT a.field, b.field
FROM tableA a LEFT JOIN tableB b on (a.id = b.id)