MySQL Forums
Forum List  »  InnoDB

Re: q about concurrency for money transfer
Posted by: irek kordirko
Date: March 10, 2012 01:30PM

What about this?

UPDATE account
SET money = money +
       CASE account_id
          WHEN 1 THEN -10
          WHEN 2 THEN 10
       END
WHERE account_id IN ( 1, 2 )
    AND 0 < ( select units from view1 where product = 1 )

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: q about concurrency for money transfer
890
March 10, 2012 01:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.