oracle - SQL Join with one column in the joining table -
q: there 2 tables emp , dept having 1 column each i.e id column
tables as
emp table dept table id id 1 1 1 1 2 2
and join query
select * emp e,dept d e.id = d.id?
and result of above join :
id id 1 1 1 1 1 1 1 1 2 2
but not able understand how comes. can 1 explain me this?
a join
repeats each row in right hand table each row in left hand table, limited on
clause.
so each row id = 1
repeated twice, resulting in 4 rows id = 1
.
if you'd add row id = 1
both tables, you'd 3 x 3 = 9
rows id = 1
in result.
Comments
Post a Comment