What are the syntax and use of the COALESCE function?
0
The COALESCE() function evaluates the arguments in sequence and returns the first NON-NULL value in a specified number of expressions. If it evaluates arguments as NULL or not found any NON-NULL value, it returns the NULL result.
The syntax of COALESCE function is given below:
-
COALESCE (exp1, exp2, .... expn)
Example:
-
SELECT COALESCE(NULL, 'Hello', 'Javatpoint', NULL) AS Result;
This statement will return the following output:
Sign in to add a comment
0 Answers
0
📝 No answers yet!
Be the first to answer this interview question.
Your Answer
Sign in to post your answer and help the community.