A left outer join B
B right outer join A gives the same result then what is
the use of two?
Answer Posted / 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 View All Answers
What stored by the tempdb ? : sql server database administration
How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?
What are system databases into sql server (2005/2008) : sql server database administration
How to configure odbc dsn with different port numbers?
Define model database?
What is database black box testing?
What is dimension table? : sql server analysis services, ssas
What is transaction server auto commit?
What does <> symbol mean?
How can you insert null values in a column while inserting the data?
What is a primary index?
How many ways to create table-valued functions?
What is bookmark link in ssrs?
Is sql server difficult to learn?
1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do