当我在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

最佳答案

您的列表是完整的,但仅用于您的信息INNER JOIN相当于在大多数类型的SQL中只使用普通的JOIN

关于sql - 我是否缺少任何JOIN类型?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57115712/

10-16 14:58