Application Development 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: 

Inner join performance suggest

Former Member
0 Kudos
66

Hi i m new to inner joins just let me know am i correct in writing inner join using 2 tables mara and mrc.

select amatnr aersda aernam ameins bwerks bpstat into table itab from mara as a inner join marc as b on amatnr = bmatnr where matnr in s_matnr and werks in s_werks.

Frnds plzz suggest in which shuld i write my inner join to make it performance wise more efficient.

just help me how to write inner join using 3 tables.

thanking u all.

regards,

satya

Message was edited by:

satya ranjan

7 REPLIES 7

Former Member
0 Kudos
44

Hi,

You are missing the ON addition..And in the where clause you should refer the fields with a~ or b~

select amatnr aersda aernam ameins bwerks bpstat into table itab

from mara as a inner join marc as b

<b>on amatnr = bmatnr</b>

where <b>a</b>matnr in s_matnr and <b>b</b>werks in s_werks.

Thanks,

Naren

Former Member
0 Kudos
44

I don't think the problem is with the join. But you have to make sure that s_matnr is not empty before executing this.

Rob

former_member187255
Active Contributor
0 Kudos
44

Satya,

Example of inner join using 3 tables...

select maramatnr maramtart marcwerks marcdispo

mardlgort mardlabst

into table itab

from mara

inner join marc

on maramatnr = marcmatnr

inner join mard

on marcmatnr = mardmatnr

and marcwerks = mardwerks

up to 10 rows.

Regards.

0 Kudos
44

Hi rcm,

i m getting confused yaar...

help me plzz...

regards,

satya

0 Kudos
44

OK - are you concerned about the performance or how to do the join?

Rob

0 Kudos
44

HI I M CONCERNED ABOUT JOIN.

THNKS

REGARDS,

SATYA

0 Kudos
44

Then Naren answered your question.

Rob