SQL查询语句-内连接与左连接使用
程序:
data:
begin of itab OCCURS 0,
material type /bic/oizmaterial,
batch type /bi0/oibatch,
brd type /bic/oizzbrd,
cpquabu type /bi0/oicpquabu,
end of itab.
*&**例一:
clear: itab[].
select * into corresponding fields of table itab
from ztst_he01 as a inner join ztst_he02 as b on ( a~material = b~material ).
*&**例二
clear: itab[].
select a~material b~batch a~brd a~cpquabu into corresponding fields of table itab
from ztst_he01 as a inner join ztst_he02 as b on ( a~material = b~material ).
*&**例三
clear: itab[].
select * into corresponding fields of table itab
from ztst_he01 as a inner join
ztst_he02 as b on ( a~material = b~material ) inner join
ztst_he03 as c on ( b~material = c~material ).
*&**例四
clear: itab[].
select a~material b~batch c~brd a~cpquabu into corresponding fields of table itab
from ztst_he01 as a inner join
ztst_he02 as b on ( a~material = b~material ) inner join
ztst_he03 as c on ( b~material = c~material ).
*&**例五
clear: itab[].
select a~material b~batch c~brd a~cpquabu into corresponding fields of table itab
from ztst_he01 as a inner join
ztst_he02 as b on ( a~material = b~material ) inner join
ztst_he03 as c on ( b~batch = c~batch ).
*&**例六
clear: itab[].
select * into corresponding fields of table itab
from ztst_he01 as a left join
ztst_he02 as b on ( a~material = b~material ) left join
ztst_he03 as c on ( a~material = c~material ).
*&**例七
clear: itab[].
select * into corresponding fields of table itab
from ztst_he01 as a left join
ztst_he02 as b on ( a~material = b~material ) inner join
ztst_he03 as c on ( b~batch = c~batch ).
*&**例八
clear: itab[].
select * into corresponding fields of table itab
from ztst_he01 as a inner join
ztst_he02 as b on ( a~material = b~material ) left join
ztst_he03 as c on ( b~batch = c~batch ).
*&**例九
clear: itab[].
select * into corresponding fields of table itab
from ztst_he02 as a inner join
ztst_he03 as b on ( a~material = b~material and a~batch = b~batch ) .
*&**例十
clear: itab[].
select * into corresponding fields of table itab
from ztst_he02 as a left join
ztst_he03 as b on ( a~material = b~material and a~batch = b~batch ) .
*&**例二一
clear: itab[].
select a~material a~batch a~brd a~cpquabu into corresponding fields of table itab
from ztst_he02 as a left join
ztst_he03 as b on ( a~material = b~material and a~batch = b~batch ) .