Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7735053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:24:14+00:00 2026-06-01T07:24:14+00:00

I am using Mysql database. I have 3 table-: table Column tier_price customer_id,sku(Unique),price,website catalog_product

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:24:15+00:00Added an answer on June 1, 2026 at 7:24 am
    insert ignore into catalog_product
      select
        null,
        sku,
      from tier_prices
    ;
    
    insert into catalog_product_price
      select
        entity_id,
        price
      from tier_prices join
      catalog_product on tier_prices.sku = catalog_product.sku
    on duplicate key update
        catalog_product_price.price = tier_prices.price
    ;
    

    –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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MySQL database. I have one table having column with datatype binary(16).
I am using MySQL database. Supposedly I have 3 table. Table A : column
I am using MySQL Workbench to create a database. I have a table called
I have a BirthDate column in MySQL database table to store user's date of
I have a mysql database table with a column called task_end_date and task_name. I
I have a MYSQL table column of type timestamp and using CURRENT_TIMESTAMP as default
I have created a MySQL database using MySQL Workbench. It has about 20 tables.
I'm using a MySQL database. I have a products database where users can search
I am using CakePHP framework with MySQL database and I have problem in saving
I am using MySQL for my database. I have a requirement to store a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.