title: SQL match the column's value with all values of other columns EXCEPT values
body: <p>I have only one table: <em>products</em></p>
  
  <pre><code>ID | Product Name | Code 1 | Code 2 | Code 3
  ********************************************
  1  |    Phone1    |   MM   |   DD   |   nd
  2  |    Phone2    |   DD   |        |   nd
  3  |    Phone3    |   MM   |   ZZ   |   nd
  4  |    Phone4    |   XX   |        |   nd
  </code></pre>
  
  <p>I'd like to:</p>
  
  <blockquote>
    <p>select all phones which one of their codes match one of the
    <em>Phone1</em>'s code <strong>BUT NOT IF THE CODE = ND</strong></p>
  </blockquote>
  
  <p>So it should return <em>Phone2</em> and <em>Phone3</em> but now it returns them all.</p>
  
  <p><a href="http://sqlfiddle.com/#!9/84787/1" rel="nofollow noreferrer">SQL Fiddle</a> (thanks to <a href="https://stackoverflow.com/users/1221684/jamied77">@JamieD77</a>)</p>
  
  <p>I assume I should use something like this? But can't place it properly:</p>
  
  <pre><code> WHERE NOT EXISTS 
   (SELECT p1.`Product Name` 
   FROM `products` p1 
   WHERE
   p.`Product Name` = 'nd')
  </code></pre>
  
  <p>I believe there's something simpler to tell MySQL to exclude certain values in every column when it comes to finding matches.</p>