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: 

sql statement help

Former Member
0 Kudos

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?

6 REPLIES 6

former_member386202
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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).