Geeks Talk

Prepare for your Next Interview




What is the difference between self join and outer join?

This is a discussion on What is the difference between self join and outer join? within the SQL forums, part of the Databases category; fitjfdgfjgifjgjijfngijgjdgjdigdhgudhgshfhfsfdshfudsruhdrusdurudr...


Go Back   Geeks Talk > Databases > SQL

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-30-2008
Junior Member
 
Join Date: Jun 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
swapna23 is on a distinguished road
What is the difference between self join and outer join?

fitjfdgfjgifjgjijfngijgjdgjdigdhgudhgshfhfsfdshfudsruhdrusdurudr
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-03-2008
Junior Member
 
Join Date: Jun 2008
Location: Bangalore
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
jacky4u is on a distinguished road
Arrow Re: What is the difference between self join and outer join?

Hi Swapna this is the answer for your question i think

Outer joins return all rows from at least one of the tables or views mentioned in the FROM clause, as long as those rows meet any WHERE or HAVING search conditions. All rows are retrieved from the left table referenced with a left outer join, and all rows from the right table referenced in a right outer join. All rows from both tables are returned in a full outer join

A table can be joined to itself in a self-join.
Reply With Quote
  #3 (permalink)  
Old 07-17-2008
Junior Member
 
Join Date: Mar 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
csbhaskar is on a distinguished road
Re: What is the difference between self join and outer join?

You can use outer join to get the leftovers where as self join is used to compare a table with itself. In self join we consider the same table as two tables bearing the alies names
Reply With Quote
  #4 (permalink)  
Old 07-17-2008
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,432
Thanks: 8
Thanked 125 Times in 112 Posts
debasisdas will become famous soon enoughdebasisdas will become famous soon enough
Re: What is the difference between self join and outer join?

SELF JOIN --is join of the same table to itself.

OUTER JOIN-- is join to another table to select non matching records also. it can be left outer or right outer join.
Reply With Quote
  #5 (permalink)  
Old 07-17-2008
Junior Member
 
Join Date: Apr 2008
Location: Hyderabad
Posts: 28
Thanks: 1
Thanked 4 Times in 2 Posts
nageshkota is on a distinguished road
Re: What is the difference between self join and outer join?

Hi,

The Self Join is the concept joining the same table to it self, in that we use the alias concept to differ the tables.

In the Outer join we can use 3 types left, right or full, we can use the same tables for the outer join also but there won't be any meaning for that.
Reply With Quote
Reply

  Geeks Talk > Databases > SQL


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
difference between Union All and full outer join bvani MY SQL 5 10-23-2008 05:29 PM
difference between self join and correlated queries poppumca SQL 3 07-26-2008 11:30 AM
SQL Server outer join chitrab SQL Server 3 03-28-2008 04:51 AM
Outer Join Query Example mailtos.ravi SQL 4 03-05-2008 04:34 AM
Writing query with LEFT OUTER JOIN N SRIRAM K Data Warehousing 5 09-03-2007 06:08 AM


All times are GMT -4. The time now is 02:48 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved