Is it possible to use NOT NULL in a nested decode?<br>This is what I'm trying to do:<br>decode(field,NOT NULL, field value,decode(next field, NOT NULL, next field value, 'No Value Found'))<br><br>If not, how can I rewrite this to work?
If you use NOT NULL, it gets flagged as ORA-396: Missing Expression.<br>In order to accomplish what you want, you have to invert the test:<br><br>decode(field,NULL,decode(next_field,NULL,'No Value Found',next_field),field)<br><br>Rather cumbersome, but it works.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.