patternMinor
decode(null,null,'true','false') = 'true'?
Viewed 0 times
decodenulltruefalse
Problem
Today my database world was shattered.
For my whole lifetime I thought, comparing with a
But not so for the
Anybody know, what's the idea behind this?
For my whole lifetime I thought, comparing with a
null value in Oracle results in the "false-case".But not so for the
decode function.Anybody know, what's the idea behind this?
Solution
DECODE
In a DECODE function, Oracle considers two nulls to be equivalent. If expr is null, then Oracle returns the result of the first search that is also null.
In a DECODE function, Oracle considers two nulls to be equivalent. If expr is null, then Oracle returns the result of the first search that is also null.
Context
StackExchange Database Administrators Q#148887, answer score: 4
Revisions (0)
No revisions yet.