Tested on SQL 2012 Setup
Create TABLE Test1
(Id int,
Score int not null)
Create TABLE Test2
(Id int,
Score2 int not null)
insert into Test1(Id, Score) VALUES (NULL,10),(10,100),(20,200)
insert into Test2(Id, Score2) VALUES (NULL,11),(10,110),(20,220)
Case #1
Select * from Test1 JOIN Test2
ON Test1.Id = Test2.Id
Case #2
Select * from Test1 LEFT OUTER JOIN Test2
ON Test1.Id = Test2.Id
Case #3
Select * from Test1 LEFT OUTER JOIN Test2
ON Test1.Id = Test2.Id
ORDER BY Test1.Id DESC
Results are
Happy Learning!!!
No comments:
Post a Comment