New Zenner
- Join Date:
- Dec 2008
- Location:
- Amsterdam, The Netherlands
- Posts:
- 21
- Plugin Contributions:
- 0
Problems with query change price in 2 tables
I have a problem to change prices from 1 table to another table.
table 1
inventory
-itemnumber
-price
table 2
zen_products
-products_model
-products_price
in table 1 (inventory) are the right prices
it's has to compare the itemnumber with the products_model when it is the same, change the price from table zen_products with the price from tabel inventory.
I have try this for someny hours, but everytime with this query below the prices from table 2 = zero
below the query i use.
I hope somebody can help me with that.
Thanks.
UPDATE zen_products
SET products_price = ( SELECT inventory.Price
FROM inventory
WHERE inventory.itemNumber = zen_products.products_model)
WHERE EXISTS
( SELECT inventory.Price
FROM inventory
WHERE inventory.itemNumber = zen_products.products_model);