title: Is there any way to run an except query on MSSQL that uses only part of the columns?
body: <p>What I need to do is the following:</p>
  
  <p>I have in my database a table like this:</p>
  
  <pre><code>idx   |   name   |   age
  ------ ---------- -------
   1    |   John   |    18
   2    |   Marry  |    19
   3    |   Eric   |    17
  </code></pre>
  
  <p>Then I get a secondTable:</p>
  
  <pre><code>name  |  age
  ------ -----
  Moses |   29
  John  |   18
  Eric  |   20
  </code></pre>
  
  <p>I would like to run an except query like:</p>
  
  <pre><code>select   * 
  from     firstTable 
  where    (name, age) not in (select * from secondTable)
  </code></pre>
  
  <p>and an intersect query like this:</p>
  
  <pre><code>select   * 
  from     firstTable 
  where    (name, age) in (select * from secondTable)
  </code></pre>
  
  <p>So the result for the first query will be:</p>
  
  <pre><code>2   | Marry  | 19
  ---- -------- ----
  3   | Eric   | 17
  </code></pre>
  
  <p>and the result for the second query will be:</p>
  
  <pre><code>1   |  John  | 18
  </code></pre>
  
  <p>I've also found a solution that recommends on the following:</p>
  
  <pre><code>select  * 
  from    firstTable 
  where   EXISTS (select 1 
                  from   secondTable 
                  where  firstTable.name = secondTable.name 
                  and    firstTable.age = secondTable.age)) 
  </code></pre>
  
  <p>but then if I have on both tables "john - null" it will treat them as unknown (neither equal nor un-equal). I know the reason for that, but I do need them to be equal.  </p>
  
  <p>The reason I need to do this is in order to preserve the current index values to the query's result.</p>