Question about joining tables

What connection is valid for the next sql statement?

select * 
from table1 tbl1, table2 tbl2 
where tbl1.id = tbl2.id

Does it return a result only if both identifiers match?

+3
source share
2 answers

This is an inner connection.

Yes, only records with corresponding identifiers will be returned.

This is the same as:

select * 
from table1 tbl1 
 inner join table2 tbl2 
    on tbl1.id = tbl2.id

Personally, I prefer an explicit designation INNER JOIN.

+4
source

Yes, this is the ANSI-89 syntax for internal joins. ANSI-92 defines the keywords [INNER, LEFT, etc.] JOIN.

+4
source

All Articles