我是否缺少任何JOIN类型?

时间:2019-07-19 15:40:54

标签: sql sql-server oracle postgresql db2

在编写一些方法来简化Java中的联接时,我意识到联接可以采用以前从未见过的多种形式。

我想念任何类型吗?

-- Old-school inner/outer join, pre SQL-92
FROM t, u WHERE <predicate>

-- Inner joins
FROM t INNER JOIN u ON <predicate>
FROM t INNER JOIN u USING (<columns>)

-- Outer joins
FROM t LEFT OUTER JOIN u ON <predicate>
FROM t LEFT OUTER JOIN u USING (<columns>)
FROM t RIGHT OUTER JOIN u ON <predicate>
FROM t RIGHT OUTER JOIN u USING (<columns>)
FROM t FULL OUTER JOIN u ON <predicate>
FROM t FULL OUTER JOIN u USING (<columns>)

-- Cross join
FROM t CROSS JOIN u

-- Natural inner join
FROM t NATURAL INNER JOIN u

-- Natural outer joins
FROM t NATURAL LEFT OUTER JOIN u
FROM t NATURAL RIGHT OUTER JOIN u
FROM t NATURAL FULL OUTER JOIN u

-- Union join (defined in SQL-92, deprecated in SQL:2003)
FROM t UNION JOIN u

1 个答案:

答案 0 :(得分:1)

您的列表是完整的,但是仅供参考INNER JOIN相当于在大多数SQL版本中仅使用普通的JOIN