2007 Nov 15 8:09 AM
Hi
what is correct way to write the sql statement in abap way. My sql statement is below:
select name from studenttable s , admintable a
where s.admino = a.admino
this sql using 2 tables which is studenttable and admintable. how to write this sql statement in abap sql.
any help?
2007 Nov 15 8:13 AM
Hi,
Select studenttable~s
admintable~a
into table itab
from studenttable as studenttable
inner join on admintable as admintable
where studenttables = admintablea.
Reward Points if helpfull
Regards,
Prashant
Message was edited by:
Prashant Patil
2007 Nov 15 8:15 AM
SELECT s~name
into w_name " declare DATA: w_name(40) type c.
from studenttable as s JOIN admintable as a
on sadmino = aadmino.
Message was edited by:
Jyothi
2007 Nov 15 8:15 AM
Hi Gary,
do like this
Select name astudent bf1 from student as a innerjoin admin as b into table itab
where astudent-studentno = badmin-studentno.
Regards,
Satish
2007 Nov 15 8:18 AM
data : begin of itab occurs 0,
vname(40),
end of itab.
select s~name into table itab
from student as s inner join
admintable as a
on sadmino = aadmino.
regards
shiba dutta
2007 Nov 15 8:22 AM
HI
select name from studenttable s , admintable a
where s.admino = a.admino
this can be writen in ABAP in 2 ways
by useing JOINS and FOR ALL ENTRIES
select name from s into table itab where adminum = condition
select name from a into table itab2 for all entries in itab where s-name = itab1-name,
or
select s~name a~name from s inner join a
where condition
2007 Nov 15 8:26 AM
data: it_student type table of studenttable.
SELECT s~studenttable
INTO CORRESPONDING FIELDS OF TABLE it_student
FROM ( studenttable AS s
INNER JOIN admintable AS a ON sadminno = aadminno).