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
Any one plz send me SQL Server Developer/DBA resume for 4 years experience
What is the difference between left and right outer join?
How to use the inserted and deleted pseudo tables?
In what three ways is the return statement used in a stored procedure?
What do you mean by a Composite primary key?
What are trace files?
What are the different methods available under sqlcommand class to access the data?
What do you need to connect php to sql server?
What are entities and relationships?
What will happen if a column containing char type data is changed to the nchar data type?
What is a view and what are its advantages?
What is the sql server 2000 version number?
How to use “drop” keyword in sql server and give an example?
Explain the working of sql privileges?
Give some Scenario for Non Clusterd index? Can we write system defined functions in side The Function? Wat is the Unique Datatype?