Suppose I have a table called an exam. Each line contains:
examDate
userId
passed
Thus, we could have the following results:
January 1, 2010, 7, false
January 2, 2010, 8, true
January 3, 2010, 7, true
January 3, 2010, 9, false
I want to run a report that includes all users who NEVER passed the exam. In the above example, only userId 9 request should be returned by this request.
I do not want to do something really inefficient, for example:
Select * from exam where passed = 'false' and userId Not In
(Select userId from exam where passed = 'true');
source
share