User Tools

Site Tools

A PCRE internal error occured. This might be caused by a faulty plugin


**HPL/SQL is included to Apache Hive since version 2.0** * [[home|Home]]\\ * [[why|Why HPL/SQL]]\\ * [[features|Key Features]]\\ * [[start|Get Started]]\\ * [[doc|HPL/SQL Reference]]\\ * [[download|Download]]\\ * [[new|What's New]]\\ * [[about|About]]


====== COALESCE Function - PL/HQL Reference====== COALESCE function returns first non-NULL expression. **Syntax**: <code language="sql"> COALESCE(expr1, expr2 [, expr3, ...]); </code> **Parameters:** | **Parameter** | **Type** | **Value** | | exprN | Any | Variable or expression | **Notes**: * When first non-NULL expression is found the following expressions are not evaluated * COALESCE and [[nvl|NVL]] functions are synonyms **Return Value:** * First non-NULL expression * NULL if all expressions evaluate to NULL **Return Type:** The data type of first non-NULL expression. **Example 1:** <code language="sql"> COALESCE(NULL, 1, 2, 3); </code> Result: 1 **Compatibility**: Oracle, IBM DB2, Teradata, Microsoft SQL Server, PostgreSQL, MySQL and Netezza **Version**: PL/HQL 0.03 See also: * [[nvl|NVL]]