Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>They may, in your specific testing case, produce the same results. However, they will not always.</p> <p>An outer join, instead of an inner join, means still show results from the main table (which depends on whether you're using left or right outer join) even if there is no corresponding row in the secondary table.</p> <p>An inner join would not show the result at all if there was a row in the main table that matched the <code>WHERE</code> conditions but did not have a row that it could join with in the secondary table.</p> <p>If your tables that you're joining in testing have matching rows for every result (i.e. every row in <code>left_table</code> has a row in <code>right_table</code> with the same value in the <code>name</code> field), then you won't see any difference.</p> <p>What would make a difference is if you had some rows in one table, or in each table, that didn't have a row in the other table.</p> <p>For: <code>select * from left_table left outer join right_table on...where...</code> and there are some rows in the <code>right_table</code> that meet the conditionals (in the where) but don't have a row in the <code>left_table</code>, they would not show. But if there were rows in the <code>left_table</code> that meet the conditionals without a joining row in the <code>right_table</code>, they would still show.</p> <p>Same goes reverse for <code>RIGHT OUTER JOIN</code>. </p> <p><strong>EDIT:</strong></p> <p><code>LEFT JOIN</code> and <code>LEFT OUTER JOIN</code> are aliases of each other. They are the same thing. I would just use <code>OUTER</code> to clarify for your own sake, if you'd like. I prefer to always use <code>OUTER</code> or <code>INNER</code> just so I can look quickly and see what I did.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload