I'm trying to figure out why the below SQL statement does not return the value do in oracle
Select 'do' from dual
where trim(' ') = ''
Where as
Select 'do' from dual
where trim(' a ')='a'
returns the value do.
because trim(' ')
returns null
and not ''
SQLFiddle example
In Oracle 8, there is no such thing as a zero-length string. Any zero-length string, either from a function call or the literal '', is treated as null.
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With