Why is this query returning 0 rows?
select t.f1, t.f2
from (select null f1, \'a\' f2 from dual) t
where t.f1<>t.f2;
This is a distill
NULL value is nothing, it can't be equal or not equal to something. If you want to check if your value is null - use "IS NULL" statement:
select t.f1, t.f2
from (select null f1, 'a' f2 from dual) t
where t.f1 IS NULL
If you want to check if your values are equal or not equal - you can use COALESCE function on nullable columns:
select t.f1, t.f2
from (select null f1, 'a' f2 from dual) t
where COALESCE(t.f1, '')<>COALESCE(t.f2, '');