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

  • Home
  • SEARCH
  • 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 8476547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:12:34+00:00 2026-06-10T18:12:34+00:00

I have a products table which contains duplicate products by a column id_str and

  • 0

I have a products table which contains duplicate products by a column id_str and not id. We use the id_str to track each product. This is what I tried thus far:

Created a temp table and truncated it, then ran the following query

INSERT INTO products_temp SELECT DISTINCT id_str, id, title, url, image_url, long_descr, mp_seller_name, customer_rating, curr_item_price, base_item_price, item_num, rank, created_at, updated_at, published, publish_ready, categories, feed_id, category_names, last_published_at, canonical_url, is_curated, pr_attributes, gender, rating, stock_status, uploadedimage_file_name, updated_by, backfill_text, image_width, image_height, list_source, list_source_time, list_category, list_type, list_image, list_name, list_domain, notes, street_date, list_product_rank, created_by from products

And this moved everything over however when I searched the new table for duplicate id_str’s:

SELECT id_str, COUNT(*) C FROM PRODUCTS GROUP BY id_str HAVING C > 1

I get the same result as I do on the original table. What am i missing?

  • 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-10T18:12:35+00:00Added an answer on June 10, 2026 at 6:12 pm

    This is the simplest way I found to find and delete duplicates:

    Note: Because of a bug with the InnoDB engine, for this to work you need to change your engine to MyISAM:

    ALTER TABLE <table_name> ENGINE MyISAM
    

    then add a unique index to the column you are trying to find dup’s in using ignore:

    ALTER IGNORE TABLE <table_name> ADD UNIQUE INDEX(`<column_name>`)
    

    and change your db engine back:

    ALTER TABLE <table_name> ENGINE InnoDB
    

    and if you want you can delete the index you just created, but I would suggest also looking into what caused the duplicates in the first place.

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

Sidebar

Related Questions

I have a products table which contains information about products. Each products can have
I have a table which contains a list of products for a company. They
I have a product table which simplifies to this: create table product(id int primary
Hello i have a products table that contains normal products and configurable product It
I have a MySQL table which contains a list of all possible products a
I have a table called Products which obviously contains products. However, I need to
I have a table called products, which contains two rows (plus others):price and mfr.
I have a MySQL table which contains a number of products. What I want
I have a MySQL table which contains the following type of information: Date product
I have a situation where i have Keyword column in table which contains comma

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.