title: SQL Server can you use EXCEPT or INTERSECT and ignore a column?
body: <p>Here's my question,</p>
  
  <pre><code>CREATE TABLE
      #table1(ID int, Fruit varchar(50), Veg varchar(50))
  INSERT INTO #table1 (ID,Fruit,Veg)
  VALUES (1,'Apple', 'Potato')
  
  CREATE TABLE
      #table2(ID int, Fruit varchar(50), Veg varchar(50))
  INSERT INTO #table2 (ID,Fruit,Veg)
  VALUES (2,'Apple', 'Potato')
  
  SELECT * FROM #table1 INTERSECT SELECT * FROM #table2
  </code></pre>
  
  <p>I have two tables and I want to find rows which are the same in both, but both tables have different and unrelated ID columns. Is there any way to use INTERSECT or EXCEPT on two tables, but ignore the ID in the comparison?</p>
  
  <p>I need to keep the ID's on the returned rows, so on the example above, two rows would be returned, one with ID = 1 and another with ID=2</p>
  
  <p>If anything other than the ID's is different, then nothing would be returned.</p>
  
  <p>Thanks!</p>