Hello Folks,
I am very new to DB2
PLease help me with the below problem which I am facing
I am trying sum three columns by joining three tables. Two of the columns are from the Table B and the third column is from Table C.
Two columns from Table B are of type Decimal (7,2) and
Column from Table C is of type Decimal (8,2).
The issue is I am not getting the proper sum when I am adding
like this
Sum(Table B.Coulmn1 + Table B.Coulmn2 + Table C.Column3)
Example of query which I am using
Code:
SELECT a.DLR,a.INVOICE,sum (B.amt1+B.misc_amt+C.amt3) FROM Table1 A,
Table2 B,
Table3 C
WHERE A.emp_id=B.emp_id
AND
B.emp_id=C.emp_id
AND
A.record_type IN (1,4,5,7) group by a.dlr,a.invoice having a.dlr='89890' with ur
Please help me with this. Am I wrong doing a sum as above.