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
Why is replication required on the sql server?
Can sql servers linked to other servers like oracle?
What is difference between equi join and natural join?
What is user-defined functions? What are the types of user-defined functions that can be created?
What is instead of dml trigger?
What is transaction server implicit?
What are pessimistic lock and optimistic lock?
what is package and it uses and how can u call a package
What is difference between createstatement and preparedstatement?
Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
What keyword you will use to get schema appended to the result set of a ‘for xml’ query?
What is partition in sql server?
Why we need sql server?
What is the difference between rank and dense_rank?
What is the difference between functions and stored procedures?