Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

join

Former Member
0 Likes
580

difference between inner join and outer join

4 REPLIES 4
Read only

Former Member
Read only

Former Member
Read only

Former Member
0 Likes
553

Hi,

<b>Inner join</b> between table 1 and table 2 where column D sets the

join condition:

Table 1 Table 2

A B C D D E F G H

a1 b1 c1 1 1 e1 f1 g1 h1

a2 b2 c2 1 3 e2 f2 g2 h2

a3 b3 c3 2 4 e3 f3 g3 h3

a4 b4 c4 3

\ /

\ /

\ /

\ /

\/

Inner Join

A B C D D E F G H

a1 b1 c1 1 1 e1 f1 g1 h1

a2 b2 c2 1 1 e1 f1 g1 h1

a4 b4 c4 3 3 e2 f2 g2 h2

<b>Each comparison in the ON condition must contain a field

from the right-hand table.</b>

<b>Left outer join</b> between table 1 and table 2 where column D sets

the join condition.

Tabelle 1 Tabelle 2

A B C D D E F G H

a1 b1 c1 1 1 e1 f1 g1 h1

a2 b2 c2 1 3 e2 f2 g2 h2

a3 b3 c3 2 4 e3 f3 g3 h3

a4 b4 c4 3

\ /

\ /

\ /

\ /

\/

Left Outer Join

A B C D D E F G H

a1 b1 c1 1 1 e1 f1 g1 h1

a2 b2 c2 1 1 e1 f1 g1 h1

a3 b3 c3 2 NULL NULL NULL NULL NULL

a4 b4 c4 3 3 e2 f2 g2 h2

<b>Comparisons in the WHERE condition may not contain fields

from the right-hand table</b>

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

anversha_s
Active Contributor
0 Likes
553

hi,

table emp

empno name

a sasi

b xxx

c yyy

table sal

empno salary

a 1000

b 2000

Inner join

****************

select eempno ename

s~sal

into table int_table

from emp as e

inner join sal

on

eempno = sempno.

if you made inner join between table a and b by emp no

the selection retrives only if the condition satisfy the output will be

a sasi 1000

b xxx 2000

Outer join

*************************

select eempno ename

s~sal into table int_table

from emp as e

LEFT OUTER JOIN sal

on

eempno = sempno.

if you made outer join (left /right ) the left table kept as it is the

if the condition satisfy the right table entries will fetch else leave it blank

the output will be

a sasi a 1000

b xxx b 2000

c yyy

Rgds

Anver