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 |
could you please reply for these question: 1.About Use Apply? 2.Avoid cursors - When we have a situation that we can not avoid the use of cursor than what is the alternate solution? is there anything we can use instead of cursor to perform the desired task? which optiomize the peroformance too. 3.What is computed columns? Thanks in advance. Regards, Rupesh
What is database black box testing?
What happens when converting big values to numeric data types?
What is set nocount on and what is set nocount off?
What is the purpose of optimization?
How would you retrieve Unique rows from table without using UNIQUE and DISTINCT keyword?
what are constraints? : Sql server database administration
Why you need indexing? Where that is stored and what you mean by schema object? For what purpose we are using view?
What is an index?
What is query cost in sql server?
Is a null value equal to anything? Can a space in a column be considered a null value? Why or why not?
What is fill factor and pad index?