Question about joining tables
What kind of join i开发者_如何学运维s actually for the following sql statement?
select *
from table1 tbl1, table2 tbl2
where tbl1.id = tbl2.id
Does it only return result if both id matches?
This is an inner join.
Yes, only records that have matching IDs will be returned.
This is the same as:
select *
from table1 tbl1
inner join table2 tbl2
on tbl1.id = tbl2.id
Personally, I prefer the explicit notation of INNER JOIN
.
Yes, that is ANSI-89 syntax for an inner join. ANSI-92 defines the [INNER,LEFT, etc...] JOIN keywords.
精彩评论