php - Update a table sales with values from table products with WHERE clause in both Update and select query
My aim is to get values from table products to table sales where sales.Product= products.Productname. This works well. with the code below .
UPDATE sales SET Amount=(SELECT Selling_Price FROM products WHERE sales.Product= products.Productname); ;
My challenge now is how to update only where sales.Amount= 0. While running this code. I want Column Amount with values ' != 0 ignored .