Overriding unique indexed values

后端 未结 2 784
傲寒
傲寒 2021-01-17 06:47

This is what I\'m doing right now (name is UNIQUE):

SELECT * FROM fruits WHERE name=\'apple\';

Che

2条回答
  •  滥情空心
    2021-01-17 07:49

    check out

    INSERT IGNORE INTO ...
    

    and

    INSERT ON DUPLICATE KEY UPDATE ...
    

    Thes second method is preferred as the IGNORE statement simply causes mysql to issue warning instead of error

提交回复
热议问题