Last active
June 2, 2020 12:43
-
-
Save ckaklamanos/c7404a64958afea013b1fd88520b97bc to your computer and use it in GitHub Desktop.
CS-Cart MySQL find duplicate product codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT `product_code`, COUNT(*) c FROM [prefix]_products GROUP BY `product_code` HAVING c > 1 | |
| #Show product names | |
| SELECT a.product_code,a.status,b.product | |
| FROM xxx_products AS a | |
| LEFT JOIN xxx_product_descriptions AS b | |
| ON a.product_id= b.product_id | |
| WHERE a.product_code | |
| IN (SELECT product_code FROM xxx_products GROUP BY product_code HAVING COUNT(product_code) > 1) | |
| AND a.status='A' | |
| AND b.lang_code='el' | |
| ORDER BY a.product_code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment