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
explain different types of joins? : Sql server database administration
hi i am working as a testengineer , so i want to no the backend data base connection can any one tell mwe in detail
How to create hyperlink from returned sql query ?
How do I view a script in sql server?
Does sql server use java?
Explain the dirty pages?
Define left outer join in sql server joins?
What is the maximum size of a row in sql server?
What are the options which must be set to allow the usage of optimistic models?
How display code or Text of Stored Procedure using Sql query in Sql Server ?
What is cursors?
Characterize join and name diverse sorts of joins?
what stored procedure can you use to display the current processes? : Sql server administration
What sql server means?
How to enable/disable indexes?