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
How to define the name and server for a new dsn?
what is bit datatype and what's the information that can be stored inside a bit column? : Sql server database administration
How except clause is differs from not in clause?
How to disconnect from a sql server using mssql_close()?
What is reference section?
What is PROJECTION Operation?
How use inner join in sql server?
What is difference between stored procedure and user defined function?
How to set the current database in ms sql server?
What is partitioned view?
What is the main difference between ‘between’ and ‘in’ condition operators?
What is the importance of a recovery model?
Explain what are the restrictions that views have to follow? : SQL Server Architecture
How do you manipulate data?
1 01 101 01010