I'm trying to figure out why a simple query returns null:
SELECT CardNo FROM BOOK_LOANS WHERE DueDate=DateReturned AND
NOT EXISTS
(SELECT CardNo FROM BOOK_LOANS WHERE DueDate<>DateReturned)
I've been learning about WHERE NOT EXISTS but cant seem to find any examples using both WHERE and NOT EXISTS. Is this there a better way to go about this?
My query works when i instead use NOT IN but i have to use NOT EXISTS in this query