Compatible with PostgreSQL, Hologres 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.
Note 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 corresponding value. |
|
|
coalesce | Returns the value of the first argument in the list that is not null.
Note This function returns null only if all arguments are null.
|
|
|
nullif | Compares two arguments and returns a corresponding value. If the arguments are equal, the function returns null. If they are not equal, the first argument is returned. |
|
|
greatest | Returns the largest value from a list of arguments. |
|
|
least | Returns the smallest value from a list of arguments. |
|
|