I have a table with 3 columns - product_name, product_id and barcode. All rows have different names, id's but some rows have a duplicated barcode, I have the code I need to find the duplicates by counting them, but I can't figure out how to delete them.
I'm using MySQL workbench.
SELECT product_name, product_id, barcode,
COUNT(barcode)
FROM products.a
GROUP BY barcode
HAVING COUNT(barcode) > 1;
The duplicated barcodes should be deleted.