explain different types of jions with examples briefly?
Answer Posted / dinesh .
16)Join
Table1:Record
1 a
2 b
3 b
4 b
4 c
Table2:Record1
1 a 2
2 b 2
3 c 24
5 f 2
8 g 2
10 j NULL
Inner Join:
Qry1:select record_name,recordcount from record inner join
record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
qry2:select p.record_name,q.recordcount from record p,
record1 q where p.record_id=q.record_code
Result:
a 2
b 2
b 24
Left Join
qry3:select record_name,recordcount from record left join
record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
b NULL
c NULL
Right Join
qry4:select record_name,recordcount from record right join
record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
NULL 2
NULL 2
NULL NULL
Left Outer Join
qry5:select record_name,recordcount from record left outer
join record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
b NULL
c NULL
Right Outer Join
qry6:select record_name,recordcount from record right outer
join record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
NULL 2
NULL 2
NULL NULL
Full Outer Join
qry7:select record_name,recordcount from record full outer
join record1 on
record.record_id=record1.record_code
Result:
a 2
b 2
b 24
b NULL
c NULL
NULL 2
NULL 2
NULL NULL
"Their is No Left Inner Join,Right Inner Join in SQL Server
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
How to create percentile function?
What is triggers and stored procedures?
what is the sql equivaent of the dataset relation object ?
What is tcl in sql server?
What is the recursive stored procedure in sql server?
What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks
Explain what is the main purpose of having conversation group?
What is difference between materialized view and view?
Where can you find the error log information? : sql server database administration
Do you know exporting and importing utility?
How to name query output columns in ms sql server?
What is query parameter in ssrs?
What are rest-style architecture's?
What are the encryption mechanisms in sql server?
Describe different Processing Modes offered by SSRS?