What is the joins and how many types of Joins in sql server
a diffrentiate ever one give a suaitable query
Answer Posted / kamal
/* INNER JOIN -- Matched Rows only from Tables */
SELECT NR.RequestId, U.UserId FROM ITWP_NewRequest NR
INNER JOIN ITWP_Users U ON U.UserId = NR.UserId
/* OUTER JOIN -- Matched Rows only from Tables
RIGHT OUTER JOIN -all the rows from Right table and matched
rows from Left Table.
LEFT OUTER JOIN - all the rows from Left table and matched
rows from Right Table.
FULL OUTER JOIN - all the rows from Left table and from
Right Table.
*/
SELECT NR.RequestId, U.UserId FROM ITWP_NewRequest NR
RIGHT OUTER JOIN ITWP_Users U ON U.UserId = NR.UserId
SELECT NR.RequestId, U.UserId FROM ITWP_NewRequest NR
LEFT OUTER JOIN ITWP_Users U ON U.UserId = NR.UserId
SELECT NR.RequestId, U.UserId FROM ITWP_NewRequest NR
FULL OUTER JOIN ITWP_Users U ON U.UserId = NR.UserId
/* A Join without having any condition is known
as Cross Join, in cross join every row in first table is
joins with every row in second table.
*/
SELECT NR.RequestId, U.UserId FROM ITWP_NewRequest NR
CROSS JOIN ITWP_Users U
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the latest version of microsoft sql server?
Write a code to select distinct records without using the DISTINCT keyword.
What is an index. What are the types?
What is the use of “join” in sql server?
How to apply cascading referential integrity in place of triggers?
What is attribute relationships, why we need it? : sql server analysis services, ssas
How to test subquery results with the exists operator?
Types of Authentications in Sql Server? How user gets authenticated through windows authentication?
explain databases and sql server databases architecture? : Sql server database administration
How you can minimize the deadlock situation?
What is a not null constraint?
How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?
What stored by the model?
What are the different methods available under sqlcommand class to access the data?
What are audit control procedures?