[英]PostgreSQL INNER JOIN vs WHERE clause join
I thought INNER JOIN was equivalent to JOIN in WHERE clause. 我以为INNER JOIN相当于WHERE子句中的JOIN。 When I make join using WHERE clause, I get rows returned.
当我使用WHERE子句进行连接时,我得到返回的行。 But if I do INNER JOIN, then no rows are outputed.
但是,如果我执行INNER JOIN,则不会输出任何行。 I get result that there are no matches.
我得到没有匹配的结果。 Am I mistaken, or I'm doing something wrong?
我错了吗,或者我做错了什么?
Are these joins equivalent?: 这些联接是否等效?:
INNNER JOIN: 加盟:
account_move_reconcile_line_applied amrla
INNER JOIN account_move_reconcile_line amrl ON (amrla.credit_line_id = amrl.id)
INNER JOIN account_move_reconcile amr ON (amrl.credit_reconcile_id = amr.id)
INNER JOIN account_move_line aml ON (aml.reconcile_partial_id = amr.id)
INNER JOIN res_partner rp ON (aml.partner_id = rp.id)
IN WHERE clause: IN WHERE子句:
amrla.credit_line_id = amrl.id
and amrl.partner_id = rp.id
and amrl.credit_reconcile_id = amr.id
and aml.reconcile_id = amr.id
There was wrong ID in: ID错误:
INNER JOIN account_move_line aml ON (aml.reconcile_partial_id = amr.id)
It should have been reconcile_id instead of reconcile_partial_id. 它应该是reconcile_id而不是reconcile_partial_id。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.