title: MySQL uniqueness of value
body: <p>I have a table that contains the columns:</p>
  
  <pre><code>employer_id
  contact_id
  primary
  </code></pre>
  
  <p>First two are integers, last is a tinyint that's either 1/0.  An employer can be joined to multiple contacts and vice versa.  However, I want to enforce that there can only be one instance where primary = 1 for each a particular employer.  There can be many where primary = 0.</p>
  
  <p>Is there any way to do this through the use of constraints/keys in MySQL?</p>
  
  <p>Thanks</p>