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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -