Skip to Content
0

Subquery or Subselect is possible in ABAP CDS?

Mar 06, 2017 at 02:45 AM

715

avatar image

Hi, experts.

I want to use subquery, subselect concepts in my ABAP CDS.

What I want to do is similar to SQL below.

select

name,

round(sum(amount_paid) / (select amount_paid from order_items) * 100.0, 2) as pct

from order_items

group by 1

order by 2 desc;

-> to calculate percent of revenue each items

SELECT *

FROM flights

WHERE origin in ( SELECT code FROM airports WHERE elevation > 2000);

-> using subquery in where clause

I'm not sure whether this concept is available in ABAP CDS.

Or do I make additional view and use join or association?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Ji Hye Kim Mar 13, 2017 at 11:06 AM
0
Share
10 |10000 characters needed characters left characters exceeded