cancel
Showing results for 
Search instead for 
Did you mean: 

Aggregate in SELECT query

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Mustajab!

IMHO you can't manipulate two fields during the select (in open SQL).

If you are interested in sums (or differences) over all entries, then you can use the aggregation function SUM and make the final calculation with the total of the columns - but not line by line.

Regards,

Christian

Former Member
0 Kudos

Hi Chris,

Thanks for your prompt reply. I knew about it but just wanted to check.

Thanks again,

Regards,

Mustajab.

Answers (0)