Just a note about "conventions" which may help you understand the "id" a little better.
"id" (by common convention) is an auto-numbered integer which may be used to uniquely locate a specific row in that table.
Every table (by common convention) will have its own "id" column, but this does not mean you always join by these columns.
Table2 is likely to contain a "foreign key" which enables a join to Table1
The naming of a "foreign key" column (by common convention) is often a combination of "table name" & underscore & "id". So a possible revision to your example would be this:
Table1 Table2
________ ________________________
id name id table1_id name
1 O 1000 1 T
2 B 9678 1 N
Note how the ID from Table1 has no relationship to ID of Table2 in this example and so the query would now be:
SELECT t1.name, t2.name
FROM Table1 t1
INNER JOIN Table2 t2 ON t1.id = t2.table1_id;
Joins adhere to the logic specified, here that is t1.id must equal t2.table1_id
. There is no "first" of "last" in that logic. Any rows that meet the specified condition are joined. (nb: & this could mean no rows get joined depending on circumstances)
Please don't use commas between table names after the word FROM. Get used to the terms such as INNER JOIN, LEFT OUTER JOIN (or their abbreviations JOIN and LEFT JOIN) which is just so much better in the long run.