So you want the rows where both columns have the same value or both are null?
If so, the problem with your nvl is that the empty string "''" is also null! So when if you have rows where both are null, you effectively have null = null. Which of course, your query won't return.
To overcome this, pass an "impossible" value as the second argument to nvl:
drop table t purge;
create table t (
x int,
y int
);
insert into t values (1, 1);
insert into t values (1, 2);
insert into t values (null, null);
insert into t values (null, 1);
commit;
set null <null>
select * from t
where nvl(x, -99) = nvl(y, -99);
X Y
1 1
<null> <null>
Or you could write it out longhand, explicitly checking both for null:
select * from t
where x = y or (x is null and y is null);
X Y
1 1
<null> <null>
This avoids possible issues where the value you use in nvl turns out to be a valid!
insert into t values (null, -99);
select * from t
where nvl(x, -99) = nvl(y, -99);
X Y
1 1
<null> <null>
<null> -99
select * from t
where x = y or (x is null and y is null);
X Y
1 1
<null> <null>