|René Nyffenegger's collection of things on the web|
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
The best translation for the value NULL in SQL I can work with is unknown. Therefor, the test if null = null then is false, because we cannot know if the unknown thing on the left side of the = is the same unknown thing on the right side.
However, sometimes, it seems reasonable that null = null should indeed be true. In such a case, sys_op_map_nonnull can be used.
Warning: sys_op_map_nonnull is undocumented and there is no guarantee that it is always working as described here.
select a, b, c from t where sys_op_map_nonnull(f) = sys_op_map_nonnull(g);