The following article mainly introduces an example of Oracle left join and right join, if you are interested in the actual operations related to Oracle left join and right join, you can click to view the following articles.
(1) left join: all records in the left table of join and matching records in the right table of join are included in the query results.
(2) right join: all records in the right table of join and matching records in the left table of join are included in the query results.
(3) full join includes join in the result.
Example:
Select
- Nvl (left _. dummy, 'This is all on the right') left_dummy,
- Nvl (right _. dummy, 'This is all on the left') right_dummy
- From dual left _ left JOIN dual right _
- On left _. dummy | 'D' = right _. dummy
Select
- Nvl (left _. dummy, 'This is all on the right') left_dummy,
- Nvl (right _. dummy, 'This is all on the left') right_dummy
- From dual left _ right join dual right _
- On left _. dummy | 'D' = right _. dummy
Select
- Nvl (left _. dummy, 'This is all on the right') left_dummy,
- Nvl (right _. dummy, 'This is all on the left') right_dummy
- From dual left _, dual right _
- WHERE left _. dummy | 'D' = right _. dummy (+)
The above content is an introduction to Oracle left join right join. I hope you will have some gains.
Article by: http://www.programbbs.com/doc/5098.htm