‎2006 Aug 29 7:23 AM
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.
‎2006 Aug 29 7:33 AM
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,
‎2006 Aug 29 7:55 AM
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.