2007 Feb 23 4:53 PM
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
2007 Feb 23 4:56 PM
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
2007 Feb 23 4:57 PM
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
2007 Feb 23 4:59 PM
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.
2007 Feb 23 5:16 PM
Hi rcm,
i m getting confused yaar...
help me plzz...
regards,
satya
2007 Feb 23 5:24 PM
OK - are you concerned about the performance or how to do the join?
Rob
2007 Feb 23 5:52 PM
2007 Feb 23 6:28 PM