SELECT *
FROM ImageProperties, OccupantDetails
WHERE ImageProperties.OccupantID <> OccupantDetails.ID;
ImageProperties keeps information about what type of occupant is shown in the image. OccupantID is a foreign key and OccupantID.ID is the primary key in the OccupantDetails table. This query is suppose to check for any invalid entries in ImageProperties (where OccupantID is an invalid ID). But the result of this query seems like an infinite loop, where the 1st record in ImageProperties is return many many times. Am I using "<>" wrong? Thanks
FROM ImageProperties, OccupantDetails
WHERE ImageProperties.OccupantID <> OccupantDetails.ID;
ImageProperties keeps information about what type of occupant is shown in the image. OccupantID is a foreign key and OccupantID.ID is the primary key in the OccupantDetails table. This query is suppose to check for any invalid entries in ImageProperties (where OccupantID is an invalid ID). But the result of this query seems like an infinite loop, where the 1st record in ImageProperties is return many many times. Am I using "<>" wrong? Thanks