I'm using a php script to import values from a CSV files to table1 and then using inner join to update a field of table2 from table1:
UPDATE table2 AS t2
INNER JOIN
(
SELECT field, id
FROM table1 ) AS t1 ON (t2.id=t1.id)
SET t2.field = t2.field+t1.field;
however, if I perform two imports the fields that were updated in the first import and not in the second are being updated to max value 9999.999 , field type Decimal(7,3). Any ideas why and what might a suitable fix be? P.S the values in the table1 are correct.