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

Inner join performance suggest

Former Member
0 Likes
765

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
Read only

Former Member
0 Likes
743

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

Read only

Former Member
0 Likes
743

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

Read only

former_member187255
Active Contributor
0 Likes
743

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.

Read only

0 Likes
743

Hi rcm,

i m getting confused yaar...

help me plzz...

regards,

satya

Read only

0 Likes
743

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

Rob

Read only

0 Likes
743

HI I M CONCERNED ABOUT JOIN.

THNKS

REGARDS,

SATYA

Read only

0 Likes
743

Then Naren answered your question.

Rob