   Simple SQL query?
  I need a really simple SQL query but I can''t seem to figure it out I have a table (table1) with all my products listed. It has an ID field (let''s say there are 5 products. Product 1, 2, 3, 4 and 5). Another table (table2, also with ID field) contains all products that have changed in the last week (Say it containts products 1, 2 and 3).Now, I need and SQL query that will give me all the products that have NOT been changed. That is: All the ID''s that appear in table1 but NOT in table2. In this case, I should get back ID''s 4 and 5.So, how do I say this in SQL?   Sander Maréchal[Lone Wolves][Game Developers Emporium][E-mail][Hosting $7,95/mo][Forum FAQ][Google] 
  Assuming the tables are called "Products" and "Changes", and that the field is called "ProductID" in both tables:SELECT ProductID FROM ProductsWHERE NOT (ProductID IN (SELECT ProductID FROM Changes)); ;  Two other examples are:#1SELECT IDFROM ProductsWHERE NOT EXISTS(SELECT ID FROM Changes#2SELECT IDFROM Products LEFT OUTER JOIN ChangesON Products.ID = Changes.IDWHERE Changes.ID IS NULL;www.w3schools.com/sql/ [edited by - fraktal on March 23, 2004 5:26:47 PM]