I have 2 tables.
Table 1: ID Name Age PhoneNumber 12 Joe 25 873827382 23 Bob 28 928398233 34 Jane 23 237828883 Table 2: ID Agent QuantitySold 12 A1 100 23 B1 300 12 C1 600 34 A2 400 34 B1 800 23 B2 900 I want to show all the details of the employees who have never sold a quantity not equal to 800.
SELECT a.ID, a.Name, a.Age, a.PhoneNumber FROM table1 a LEFT JOIN table2 b ON a.ID= b.ID AND b.quantity <> 800 I want a result set that doesn't have ID 34 in it. But I cant seem to achieve that. Any help?