2016-03-23 5 views
-1
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; 

Wie kann dieser Code in mysql-Format der linken äußeren Join umgewandelt werden?komplexe Join-Operationen Konvertierung von Oracle zu MySQL

+0

Welchen Ansatz haben Sie bisher ausprobiert? Bitte sagen Sie uns und dann außer uns, um es zu beantworten. – surajsn

Antwort

0

ORACLE linken (oder rechten) wechselt vollständige Syntax MySQL äquivalent ist (außer es keine FULL OUTER JOIN in MySQLs):

ORACLE:

SELECT a.field, b.field 
FROM tableA a LEFT JOIN tableB b on (a.id = b.id) 

auch

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) 
+0

Sie bekommen es nicht. Es gibt 5 Tabellen in FROM, aber nur bei 2 Tabellen in jeder Bedingung. Wie löst man dieses Problem in MySQL? Kann ich das in MySQL schreiben: select .... aus tA links join tB auf f1 = f2, tC links join tD auf f3 = f4 ....? –