 <p>you forgot the 3th argument in your the IF function and other syntax stuff :-)</p> <p>why you make you script not with where? like this:</p> <pre><code>UPDATE saving s INNER JOIN time t ON t.ID = 'input' AND t.User = s.User SET s.balance = s.balance + t.balance * t.interest WHERE t.currency_TYPE = 'RMB'; </code></pre> <p>you will update just records with currency_type rmb!</p> <p>OR </p> <pre><code>UPDATE saving s INNER JOIN time t ON t.ID = 'input' AND t.User = s.User SET s.balance = (t.currency_TYPE = 'RMB', s.balance + t.balance * t.interest, 0); </code></pre>