Skip to main content
VeloDB Cloud 26.x·Apache Doris 4.x (≤ 4.0 supported)·"Since X.Y" tags refer to Doris versionsversion mapping →

NULL_OR_EMPTY

Description

The null_or_empty function is used to determine whether the given value is NULL or empty. If the input value is NULL or empty, it returns true; otherwise, it returns false.

Syntax

NULL_OR_EMPTY (<str>)

Parameters

  • <str>: String type, the string to be checked for NULL or empty.

Return Value

Returns true if the string is an empty string or NULL; otherwise, returns false.

Examples

  1. Example 1
    select null_or_empty(null), null_or_empty(""), null_or_empty(" ");
    +---------------------+-------------------+--------------------+
    | null_or_empty(null) | null_or_empty("") | null_or_empty(" ") |
    +---------------------+-------------------+--------------------+
    | 1 | 1 | 0 |
    +---------------------+-------------------+--------------------+