SELECT p1.ID, p1.Price, (SELECT SUM(p2.Price) FROM Products p2 WHERE p1.ID >= p2.ID) as RunningTotal FROM Products p1 WHERE RunningTotal <= 5000
I found this query and would like to use it to update the records themselves Any conversion from select to update
UPDATE Products SET g = "ok" WHERE 5000 > (SELECT SUM(p2.Price) FROM Products p2 WHERE products.ID >= p2.ID)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)