Skip to main content

zero

1. ZERO Function

The ZERO function in H2 database is used to return a numeric value of zero.

2. Syntax

The syntax for the ZERO function in H2 database is as follows:

ZERO()

Arguments

  • The ZERO function does not take any arguments.

Return

  • The ZERO function returns the numeric value zero (0).

3. Notes

  • The ZERO function in H2 database does not require any arguments and will always return zero.
  • The returned value is of type numeric.

4. Examples

Here are a few examples demonstrating the usage of the ZERO function in H2 database:

Example 1 - Returning zero:

SELECT ZERO() AS result;

Output:

result
------
0

Example 2 - Using the ZERO function in calculations:

SELECT ZERO() + 5 AS result;

Output:

result
------
5

Example 3 - Combining the ZERO function with other columns:

SELECT id, ZERO() AS zero_value, amount + ZERO() AS new_amount
FROM transactions;

Output:

id | zero_value | new_amount
---+------------+------------
1 | 0 | 100
2 | 0 | 50
3 | 0 | 0

There are no related functions specifically related to the ZERO function in H2 database.