Relational Data - Functions - Comparison Functions

From FojiSoft Docs
Revision as of 18:52, 28 August 2024 by Chris.Hansen (talk | contribs) (Import ClickHouse Docs: Wed Aug 28 2024 14:52:19 GMT-0400 (Eastern Daylight Time))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Below comparison functions return 0 or 1 as Uint8.

The following types can be compared: - numbers - strings and fixed strings - dates - dates with times

Only values within the same group can be compared (e.g. UInt16 and UInt64) but not across groups (e.g. UInt16 and DateTime).

Strings are compared byte-by-byte. Note that this may lead to unexpected results if one of the strings contains UTF-8 encoded multi-byte characters.

A string S1 which has another string S2 as prefix is considered longer than S2.

equals, =, == operators

Syntax

equals(a, b)

Alias: - a = b (operator) - a == b (operator)

notEquals, !=, <> operators

Syntax

notEquals(a, b)

Alias: - a != b (operator) - a <> b (operator)

less, < operator

Syntax

less(a, b)

Alias: - a < b (operator)

greater, > operator

Syntax

greater(a, b)

Alias: - a > b (operator)

lessOrEquals, <= operator

Syntax

lessOrEquals(a, b)

Alias: - a <= b (operator)

greaterOrEquals, >= operator

Syntax

greaterOrEquals(a, b)

Alias: - a >= b (operator)