opencart 删除重复的产品的sql

DELETE p.*, pd.*, pc.*, p2s.*, m.*, ss.* FROM oc_product p LEFT JOIN oc_product_description pd ON (p.product_id = pd.product_id) LEFT JOIN oc_product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN oc_product_to_category pc ON (p.product_id = pc.product_id) LEFT JOIN oc_manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN oc_stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.product_id not in (SELECT a FROM (SELECT MAX(`product_id`) a FROM oc_product opt WHERE  opt.`image` =  opt.`image` GROUP BY `image`)e) AND pd.language_id = '1' AND p2s.store_id = '0' AND ss.language_id = '1';
 

你可能感兴趣的:(sql)