加入&的真正区别隐式连接

时间:2015-04-03 17:00:47

标签: oracle join

我有点问题......我认为这只是一个语义问题...... 谁能解释我对这两个查询的真正差异?如果有...

// #1 - Query with join
SELECT DISTINCT cli.COD_CLIENTE   
FROM CLIENTI cli    
JOIN BANCHE b 
    ON b.COD_BANCA = cli.COD_BANCA    
JOIN SOA_CONO_VISIB cv 
    ON cv.COD_SOCIETA = b.SOCIETA_SOA     
    AND cv.FLAG_ENTITA_OPER = 1     
    AND cv.COD_MACRO_CLASSE <> 'RFE'      
    AND cv.DATA_FINE_OPERATIVITA IS NULL  
WHERE   cv.COD_SOCIETA = '01'  
    AND cv.COD_ENTITA = '00008';


// #2 - Query with implicit join        
SELECT DISTINCT cli.COD_CLIENTE   
FROM CLIENTI cli, BANCHE b, SOA_CONO_VISIB cv 
WHERE cv.COD_SOCIETA = '01'  
    AND cv.COD_ENTITA = '00008'
    AND b.COD_BANCA = cli.COD_BANCA
    AND cv.COD_SOCIETA = b.SOCIETA_SOA     
    AND cv.FLAG_ENTITA_OPER = 1     
    AND cv.COD_MACRO_CLASSE <> 'RFE'      
    AND cv.DATA_FINE_OPERATIVITA IS NULL;

1 个答案:

答案 0 :(得分:0)

它们完全相同,使用隐式连接,您必须“手动”在表之间进行引用,并且使用从许多表中选择的查询,这可能是一项过度的工作。

这里有另一个像你的问题,也许你可以找到其他信息。

http://www.stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins