I have a question very similar to another question but I can't quite figure it out. Here is the link to the original question:Oracle/SQL - Finding records with one value excluding by similar record
So similar to that problem, I have records that will either have a 1 or null. the same records can be a combination of 1 or null and in those instances, I want to exclude the record altogether. For example:
Person Type
--------------
Bob 1
Sue 1
Bob null
Tom 1
Frank 1
Frank null
Fred null
I want the following returned:
Person Type
--------------
Sue 1
Tom 1
Any direction on this would be very much appreciated. I dont have much time to solve this so even speaking conceptually will help!
The closest I came was
select person from table
where type = 'S'
MINUS
select person from table
where type is null
But of course that doesnt work.
I can write a function if that is the only way. Thank you!
Copyright Notice:Content Author:「Ryan Nalls」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/29180957/oracle-sql-finding-records-with-one-value-excluding-nulls