As you know, NaN is a “Not a Number”.
How do you think, what would be the result of the following query? (0f/0 == NaN)
select count(*) cnt from dual where rownum < 0f/0;
Answer
[sourcecode language=”sql” highlight=””]
SQL> select count(*) cnt, 0f/0 from dual where rownum < 0f/0;
CNT 0F/0
———- ———-
1 Nan
1 row selected.
[/sourcecode]
[collapse]
Ok, when you know the result, try to guess what will return this query:
select count(*) cnt from dual where 1f/0 < 0f/0;
Answer
[sourcecode language=”sql”]
SQL> select count(*) cnt from dual where 1f/0 < 0f/0;
CNT
———-
1
1 row selected.
[/sourcecode]
[collapse]
PS
[sourcecode language=”sql” highlight=””]
1 * X < 0 * Y
[/sourcecode]
So we know now which non-negative values we should to substitute for X and Y in this expression, to make it true.
[collapse]