Application Development and Automation 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: 
Read only

Aggregate in SELECT query

Former Member
0 Likes
427

Hi All,

Is it possible to manipulate(add, subtract,...) two fields belonging to two different tables in a SELECT query or JOIN statement.

Ex.

SELECT

<TABLE1>~<FIELD1>

<TABLE1>~<FIELD2>

<TABLE2>~<FIELD1>

<TABLE1>~<FIELD2>

INTO TABLE

<RESULT_TAB>

FROM

<TABLE1>

INNER JOIN

<TABLE2>

ON

<TABLE1><FIELD1> = <TABLE2><FIELD1> ...

My problem is, while selecting can i add or subtract two fields say <TABLE1><FIELD1> and <TABLE2><FIELD1>.

Regards,

Mustajab.

2 REPLIES 2
Read only

dani_mn
Active Contributor
0 Likes
382

IT is not possible directly using query.

you can do sum in 'SELECT - ENDSELECT' or after selection into internal table you can do SUM.

possible variants of SELECT are.

<b>1. fdescriptor

2. MAX( [DISTINCT] fdescriptor )

3. MIN( [DISTINCT] fdescriptor )

4. AVG( [DISTINCT] fdescriptor )

5. SUM( [DISTINCT] fdescriptor )

6. COUNT( DISTINCT fdescriptor )

7. COUNT( * )</b>

Regards,

Read only

Former Member
0 Likes
382

Hi u cannot do directly within the select query ,but u can do it with SELECT-ENDSELECT and also once that data selected into an internal table and then modify the internal table.