Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What is left outer join and right outer join

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
praneethgokul

New User


Joined: 06 May 2005
Posts: 20
Location: Bangalore

PostPosted: Tue Jul 12, 2005 7:19 pm    Post subject: What is left outer join and right outer join
Reply with quote

hi all,


what is left outer join and right outer join?

please give me one example also

how to convert to vsam records to db2 table?
Back to top
View user's profile Send private message

vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Wed Jul 13, 2005 3:59 pm    Post subject:
Reply with quote

db2 => select tab1.*, childname from tab1 full outer join tab2 on
tab1.empno = tab2.empno
db2 => select tab1.*, childname from tab1 left outer join tab2 on
tab1.empno = tab2.empno
db2 => select tab1.*, childname from tab1 right outer join tab2 on
tab1.empno = tab2.empno

D:\PROGRA~1\SQLLIB\BIN>db2 select * from tab1

EMPNO NAME
----------- --------------------
1 a
2 b
3 c
4 d
5 e

5 record(s) selected.


D:\PROGRA~1\SQLLIB\BIN>db2 select * from tab2

EMPNO CHILDNAME
----------- --------------------
1 a
3 c
4 d
7 x

4 record(s) selected.


D:\PROGRA~1\SQLLIB\BIN>db2 select tab1.*, childname from tab1 left outer
join tab2 on tab1.empno = tab2.empn
o

EMPNO NAME CHILDNAME
----------- -------------------- --------------------
1 a a
2 b -
3 c c
4 d d
5 e -

5 record(s) selected.


D:\PROGRA~1\SQLLIB\BIN>db2 select tab1.*, childname from tab1 right outer
join tab2 on tab1.empno = tab2.emp
no

EMPNO NAME CHILDNAME
----------- -------------------- --------------------
1 a a
3 c c
4 d d
- - x

4 record(s) selected.

D:\PROGRA~1\SQLLIB\BIN>db2 select tab1.*, childname from tab1 full outer
join tab2 on tab1.empno = tab2.empn
o

EMPNO NAME CHILDNAME
----------- -------------------- --------------------
1 a a
3 c c
4 d d
- - x
2 b -
5 e
-
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us