composite key duplicate mysql code example
Example 1: find duplicate keys in mysql
SELECT col, COUNT(col) FROM table_name GROUP BY col HAVING COUNT(col) > 1;
Example 2: mysql on duplicate key ignore
INSERT INTO table_tags (tag) VALUES ('tag_a'),('tab_b'),('tag_c') ON DUPLICATE KEY UPDATE tag=tag;