UPDATE Pricelist as p JOIN Lots as l
ON p.id = l.ID_of_price
SET p.Own_Price = IF (p.prices = l.prices, 1, 0)
WHERE p.id = l.ID_of_price
UPDATE Pricelist SET Own_Price = 0;
UPDATE Pricelist as p JOIN Lots as l
ON p.id = l.ID_of_price
SET p.Own_Price = IF (p.prices = l.prices, 1, 0);