title: MySQL: Insert multiple values if they don't exist, but need a multiple column check
body: <p>I have a simpe query like so:</p>
  
  <pre><code> INSERT INTO myTable (col1, col2) VALUES 
    (1,2),
    (1,3),
    (2,2)
  </code></pre>
  
  <p>I need to do a check that no duplicate values have been added BUT the check needs to happen across both column: if a value exists in <code>col1</code> AND <code>col2</code> then I don't want to insert. If the value exists only in one of those columns but not both then then insert should go through..</p>
  
  <p>In other words let's say we have the following table:</p>
  
  <pre><code> +-------------------------+
   |____col1____|___col2_____|
   |      1     |     2      |
   |      1     |     3      |
   |______2_____|_____2______|
  </code></pre>
  
  <p>Inserting values like <code>(2,3)</code> and <code>(1,1)</code> would be allowed, but <code>(1,3)</code> would not be allowed.</p>
  
  <p>Is it possible to do a <code>WHERE NOT EXISTS</code> check a single time? I may need to insert 1000 values at one time and I'm not sure whether doing a <code>WHERE</code> check on every single insert row would be efficient.</p>
  
  <p>EDIT:
  To add to the question - if there's a duplicate value across both columns, I'd like the query to ignore this specific row and continue onto inserting other values rather than throwing an error.</p>