none
MS SQL Server 'not in' syntax

    Question

  • I am trying to run the following query in MS SQL Server 2005:

     

     select count(*) as newevalscount
         from table2
         where cat_key not in(select cat_key from table1)

    MS SQL Server says the query was successful and brought back a count of 0.  However, there ARE several thousand records in table2 that are not in table1. 

    How else can I write this statement to get the results I want.

    Thanks

    Tasha

    Tuesday, June 21, 2011 9:15 PM

Answers