I am using Mysql database. I have 3 table-:
table Column
tier_price customer_id,sku(Unique),price,website
catalog_product entity_id(PK), sku
catalog_product_price entity_id, value
Now I want to insert those prices from tier_price table into catalog_product_price table for which SKU is not available in catalog_product table & just update those prices in catalog_product_price table for which SKU is already available in catalog_product table.
$query_fetch = "SELECT price,sku FROM tier_price";
$result_fetch = mysql_query($query_fetch);
$num_rows = mysql_num_rows($result_fetch);
$query_fetch1 = "SELECT sku FROM catalog_product";
$result_fetch1 = mysql_query($query_fetch1);
$num_rows1 = mysql_num_rows($result_fetch1);
So how to do that? Is there any way to do that?
Please guide me or provide me some idea.
–needs tested–
Note: sku would have to be a unique key in catalog_product and entity_id in catalog_product_price
Updated to match question definition.