MySQL Forums
Forum List  »  Newbie

Re: using Insert Ignore for a specific column only
Posted by: Phillip Ward
Date: November 08, 2022 07:50AM


... the email entered by the administrator to identify an employee.

Identifying implies uniqueness.
No employee should be using the same email address to work for more than one company (that's just a Data Breach waiting to happen!).


Can I index on two fields to stop dupes?

Yes, you can but just be aware that this is recording a different relationship.
An employee probably can take part in any number of campaigns, but each campaign only once, so a unique index on ( campaign, employee_email ) would cover that.

Regards, Phill W.

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.