SELECT *
FROM
daaddress ad,
(daname nam LEFT OUTER JOIN daenttonam etn on nam.entity_id = etn.entity_id)
我不明白用逗号分隔且没有 JOIN 语句的两个“表”应该做什么。是满的吗?
SELECT *
FROM
daaddress ad,
(daname nam LEFT OUTER JOIN daenttonam etn on nam.entity_id = etn.entity_id)
我不明白用逗号分隔且没有 JOIN 语句的两个“表”应该做什么。是满的吗?
daadress
它输出和之间LEFT JOIN
的笛卡尔积。daname
daenttonam
使用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
在不了解模型细节的情况下很难说出它的目的。