在 PostgreSql 中仅使用 JOIN 时使用哪种连接类型?
Which join type is used when using just JOIN in PostgreSql?
当我在数据库系统中使用它时,我更喜欢指示连接类型,但是当我切换到一个新项目时,只使用了一个 join
。一般我比较喜欢根据自己的需要使用LEFT JOIN
或者INNER JOIN
,但是我没有发现在PostgreSQL
中使用单个JOIN
时考虑的是哪种JOIN类型。
select p.uuid from Product s " +
join Category c on p.uuid = c.siteUuid
join Brand b on b.uuid = c.brandUuid
内部联接是我们使用普通联接时的默认联接 JOIN
。
为了更好的查询可读性,最好写成INNER JOIN
参考:
https://www.postgresql.org/docs/current/queries-table-expressions.html#id-1.5.6.6.5.6.4.3.1.2
当我在数据库系统中使用它时,我更喜欢指示连接类型,但是当我切换到一个新项目时,只使用了一个 join
。一般我比较喜欢根据自己的需要使用LEFT JOIN
或者INNER JOIN
,但是我没有发现在PostgreSQL
中使用单个JOIN
时考虑的是哪种JOIN类型。
select p.uuid from Product s " +
join Category c on p.uuid = c.siteUuid
join Brand b on b.uuid = c.brandUuid
内部联接是我们使用普通联接时的默认联接 JOIN
。
为了更好的查询可读性,最好写成INNER JOIN
参考: https://www.postgresql.org/docs/current/queries-table-expressions.html#id-1.5.6.6.5.6.4.3.1.2