Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

2 Select Queries into 1

$
0
0

Hello Experts,


Can anyone tell me how to do this using in one select query:


I am hitting the same table twice. May be there is a way to do this using 'table aliasing' which i am not familiar.

 

There is one to many relation ship between fld1 and fld2.  one fld1 has 1 or more values for fld2.

 

1)Hit the table to fetch fld1 from table table:

select single fld1 into lv_val1 from table1 where fld2 = some_value1.

 

 

 

2) Using the value in lv_val1 i am hitting the table table1 again as below:

   

    Select fld2 fld3 into table it_tab from table1 where fld1 = lv_val1.

 

Thanks


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>