title: MySQL two-column unique key
body: <p>I know that i can make two columns unique keys, but that's not exactly what i want.</p>
  
  <p>I want that for example if <code>col1='1', col2='2'</code> then there can't be another row with <code>col1='1', col2='2'</code>, but totally possible to do the following:</p>
  
  <pre><code>+--------+--------+
  |  col1  |  col2  |
  +--------+--------+
  |    1   |    1   |
  |    1   |    2   |
  |    2   |    1   |
  |    2   |    2   |
  +--------+--------+
  </code></pre>
  
  <p>while this is impossible:</p>
  
  <pre><code>+--------+--------+
  |  col1  |  col2  |
  +--------+--------+
  |    1   |    1   |
  |    1   |    1   |
  +--------+--------+
  </code></pre>
  
  <p>Making both unique keys is not an option as in <code>col1='1', col2='1'</code> and <code>col1='1', col2='2'</code> <code>col1</code> is the same and that's not allowed if both are unique keys.</p>