Do rows's order in multiple tables have to match so the JOIN commands combine/exclude them properly?

The LEFT JOIN and INNER JOIN commands join tables, combine rows with matching information and exclude those that don’t. The examples provided show this but the rows’ order match as well. Is this a condition for the command to properly match rows or can rows match no matter the order there in the tables?

Hi, welcome to the Forums!

No, row order doesn’t matter.

You’re joining on a column that is in both tables (PRIMARY KEY in one table FOREIGN KEY in the other table.)

INNER JOIN or, JOIN returns the records that both tables have in common.

LEFT JOIN returns all records from the LEFT table that have a match in the RIGHT table.
if there is no match, it’ll be empty, or NULL.

You can also add a WHERE condition to further narrow your results.

2 Likes

Got it. Thank you very much!

1 Like