Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


A left outer join B
B right outer join A gives the same result then what is
the use of two?



A left outer join B B right outer join A gives the same result then what is the use of two?..

Answer / nithya

Is ur query used in any situation? bcos
In general join is used in the following case:

consider "Persons" table:
P_Id LastName FirstName Address City
1 Hansen Ola Timoteivn 10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger

"Orders" table:
O_Id OrderNo P_Id
1 77895 3
2 44678 3
3 22456 1
4 24562 1
5 34764 15

left outer join:

SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo
FROM Persons
LEFT outer JOIN Orders
ON Persons.P_Id=Orders.P_Id
ORDER BY Persons.LastName

The result-set will look like this:
LastName FirstName OrderNo
Hansen Ola 22456
Hansen Ola 24562
Pettersen Kari 77895
Pettersen Kari 44678
Svendson Tove

right outer join:

SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo
FROM Persons
RIGHT JOIN Orders
ON Persons.P_Id=Orders.P_Id
ORDER BY Persons.LastName

The result-set will look like this:
LastName FirstName OrderNo
Hansen Ola 22456
Hansen Ola 24562
Pettersen Kari 77895
Pettersen Kari 44678
34764

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Explain in brief about Microsoft SQL server?

0 Answers  


Explain what is dbcc?

0 Answers  


How use inner join in sql server?

0 Answers  


What is a partition key?

0 Answers  


How to modify the underlying query of an existing view?

0 Answers  


What is the difference between getdate and sysdatetime?

0 Answers  


Explain indexes disadvantages?

0 Answers  


Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?

0 Answers  


What is the difference between Drop and Truncate

20 Answers   GT Nexus, IBM,


What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

11 Answers   World Tech, Yardi Software,


What is the recovery model?

0 Answers  


What are the advantages of using cte?

0 Answers  


Categories