id ではなく列 id_str によって重複した製品を含む製品テーブルがあります。id_str を使用して各製品を追跡します。これは私がこれまで試したことです:
一時テーブルを作成して切り捨て、次のクエリを実行しました
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
そして、これはすべてを移動しましたが、新しいテーブルで重複する id_str を検索したとき:
SELECT id_str, COUNT(*) C FROM PRODUCTS GROUP BY id_str HAVING C > 1
元のテーブルと同じ結果が得られます。私は何が欠けていますか?