Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Output for Joins

Author  Topic 

nicky_river
Yak Posting Veteran

55 Posts

Posted - 2010-10-19 : 01:29:20
Hi

Please see the table given below

Table A Table B
id emp id emp
1 A 1 X
2 B 2 Y
3 C

What will be the output for Inner join, Left Outer Join, Right Outer Join and Full Outer Join for the above 2 tables

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-19 : 01:57:48
How about you try writing the queries and checking?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

nicky_river
Yak Posting Veteran

55 Posts

Posted - 2010-10-19 : 02:29:43
Hi,

Please provide me the answer to the joins
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-19 : 02:33:59
Please provide better sample data. Show the sample data for each table and not together in one result set.

An inner join will show the matches of the join condition.

A left outer join will show the matches plus everything from the left table.

A right outer join will show the matches plus everything from the right table. Right outer joins are typically frowned up and can typically rewritten to use a left outer join instead.

A full outer join will merge everything together.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -