Oracle/SQL - Finding records with one value excluding nulls -
i have question similar question can't quite figure out. here link original question:oracle/sql - finding records 1 value excluding similar record
so similar problem, have records either have 1 or null. same records can combination of 1 or null , in instances, want exclude record altogether. example:
person type -------------- bob 1 sue 1 bob null tom 1 frank 1 frank null fred null
i want following returned:
person type -------------- sue 1 tom 1
any direction on appreciated. dont have time solve speaking conceptually help!
the closest came was
select person table type = 's' minus select person table type null
but of course doesnt work.
i can write function if way. thank you!
try this:
select person, type table type = '1' , person not in (select person table type null)
Comments
Post a Comment