0
SELECT * 

FROM 
    daaddress ad, 
    (daname nam LEFT OUTER JOIN daenttonam etn on nam.entity_id = etn.entity_id) 

我不明白用逗号分隔且没有 JOIN 语句的两个“表”应该做什么。是满的吗?

4

1 回答 1

3

daadress它输出和之间LEFT JOIN的笛卡尔积。danamedaenttonam

使用JOIN语法,它可以重写为:

SELECT  * 
FROM   daaddress ad
CROSS JOIN
(
       daname nam
LEFT OUTER JOIN
       daenttonam etn
ON     nam.entity_id = etn.entity_id
) 

括号可以省略:

SELECT  * 
FROM   daaddress ad
CROSS JOIN
       daname nam
LEFT OUTER JOIN
       daenttonam etn
ON     nam.entity_id = etn.entity_id

在不了解模型细节的情况下很难说出它的目的。

于 2012-06-06T12:22:04.507 回答