
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Perform Null Check Using HANA SQL Script
You can go for using either NULLIF or COALESCE function to serve your requirement.
NULLIF (expression, expression"): This function will return the same type whatever is specified as the first expression.
Basically, NULLIF returns
The first expression if the two expressions are not equal.
NULL of type of first expressions if the expressions are equal
The other function available is COALESCE which basically checks if the first Value provided is NULL then it will return the second value.
Example
c = COALESCE(b , a)
If b is null then the function will return an otherwise b. So If you need to put a null check and use some default value in place of NULL then you can go ahead and use COALESCE.
Advertisements