I have two tables test1 and test2 both with single column containing some values.
I have applied the inner and outer joins but have confusion with the output.
Create table test1
( id int)
insert into test1 values (1)
insert into test1 values (1)
insert into test1 values (1)
Create table test2
( id int)
insert into test2 values (1)
insert into test2 values (1)
insert into test2 values (NULL)
select a.id from test1 a inner join test2 b on a.id = b.id
I was expecting,
1
1
Null
as output for inner join, left join and right join.
But the original output was,
1
1
1
1
1
1
Could you please help me in understanding this on all the joins.