I have these two queries, the second one is returning same ID in multiple records while the first one doesn't. In my mind they both should give the same result, what am I missing here? Can someone help me understand the difference between these two queries.
------------FIRST-----------------
SELECT DISTINCT ID FROM TABLE WHERE KEY = 'TRUE' AND ID NOT IN
(SELECT DISTINCT ID FROM TABLE WHERE KEY = 'TRUE' AND VALUE = 0));
----------SECOND-----------------
SELECT DISTINCT ID FROM TABLE WHERE KEY = 'TRUE' AND VALUE != 0;