Hologres is compatible with PostgreSQL and allows you to use standard PostgreSQL syntax for data development. Hologres supports a subset of PostgreSQL functions. This topic describes the conditional functions that are supported by Hologres and sample statements of these functions.
For more information about how to use conditional functions, see Conditional functions.
In the following table, the sample statements are executed on the test table and the execution results are provided in the Result column. The test table contains the following data:
a
---
1
2
3
Function | Description | Sample statement | Result |
case | Goes through conditions until a condition is determined to be true and then returns a value. |
|
|
coalesce | Returns the value of the first expression in the list that is not null. Note This function returns null only if all expressions are null. |
|
|
nullif | Compares two expressions and returns a value. If the expressions are equal, the function returns null. If they are not equal, the value of the first expression is returned. |
|
|
greatest | Returns the largest value from a list of expressions. |
|
|
least | Returns the smallest value from a list of expressions. |
|
|