15 Jan
2009
15 Jan
'09
2:22 p.m.
Can't you do the select and update as part of one transaction?
For example with MySQL:
START TRANSACTION;
SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
UPDATE table2 SET summary=@A WHERE type=1;
COMMIT;
AFAIK it is the transaction. Problem is that update will work for all three users. Adding expiry_time IS NULL to update will cause it to work only for the first user. Ivan Kalik Kalik Informatika ISP