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

Default join in select statements

Former Member
0 Likes
2,333

Hi guyz,

If I am using just Join in my select statement. What does it do by default

1. innter join

2. outer join

eg:

select vbeln posnr into table itab from vbak <b>join</b> vbap on vbakvbeln = vbapvbeln.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,301

Hi,

By default it is INNER JOIN.

Regards,

Anji

4 REPLIES 4
Read only

Former Member
0 Likes
1,302

Hi,

By default it is INNER JOIN.

Regards,

Anji

Read only

Former Member
0 Likes
1,301

Its inner join by default.

Read only

Former Member
0 Likes
1,301

Mgs,

By Default innerjoin.

See the diff.

Hi karan check also the "left outer join" statement.

It might help you if you need 1-N relation

  • // left outer Join

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






|--|||--|

\ /

\ /

\ /

\ /

\/

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 |

|--||||||||--|

  • // Inner Join

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










Pls. mark if useful

Read only

Former Member
0 Likes
1,301

Hi mg s,

Actually the join statment is an SQL statement. There are two joins , Inner join and Outer join.

Inner join is the default join in the select statement. It can also be called as join by default.

Coming to outer join, It is used to map all the field of the first table with one field of second table.

Hope this helps you.

Reward all the useful answers.

Regards