hi all,
Consider the following senario:
Salesman 1 sells three shirts
Salesman 1 retrieves current shirt count (47):
SELECT quantity FROM inventory WHERE item='shirt'
Salesman 2 sells two shirts
Salesman 2 retrieves current shirt count (47):
SELECT quantity FROM inventory WHERE item='shirt'
Salesman 1 computes new inventory level: 47 - 3 = 44 and updates shirt count:
UPDATE inventory SET quantity = 44 WHERE item = 'shirt'
Salesman 2 computes new inventory level: 47 - 2 = 45 and updates shirt count:
UPDATE inventory SET quantity = 45 WHERE item = 'shirt'
At the end of this sequence, five shirts are sold (that's good), but the inventory level says 45 rather than 42 (that's bad).
The problem arises when two or more SQL statements are dependent.

any ideas ?