Skip to main content
Skip to main content

Comparison Functions

Comparison rules

The comparison functions below return 0 or 1 with type UInt8. Only values within the same group can be compared (e.g. UInt16 and UInt64) but not across groups (e.g. UInt16 and DateTime). Comparison of numbers and strings are possible, as is comparison of strings with dates and dates with times. For tuples and arrays, the comparison is lexicographic meaning that the comparison is made for each corresponding element of the left side and right side tuple/array.

The following types can be compared:

  • numbers and decimals
  • strings and fixed strings
  • dates
  • dates with times
  • tuples (lexicographic comparison)
  • arrays (lexicographic comparison)
note

Strings are compared byte-by-byte. 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

Introduced in: v1.1

Syntax

Arguments

  • a — First value.*
  • b — Second value.*

Returned value

Returns 1 if a is equal to b, otherwise 0. UInt8

Examples

Usage example

greater

Introduced in: v1.1

Syntax

Arguments

  • a — First value.*
  • b — Second value.*

Returned value

Returns 1 if a is greater than b, otherwise 0. UInt8

Examples

Usage example

greaterOrEquals

Introduced in: v1.1

Syntax

Arguments

  • a — First value.*
  • b — Second value.*

Returned value

Returns 1 if a is greater than or equal to b, otherwise 0. UInt8

Examples

Usage example

less

Introduced in: v1.1

Syntax

Arguments

  • a — First value.*
  • b — Second value.*

Returned value

Returns 1 if a is less than b, otherwise 0. UInt8

Examples

Usage example

lessOrEquals

Introduced in: v1.1

Syntax

Arguments

  • a — First value.*
  • b — Second value.*

Returned value

Returns 1 if a is less than or equal to b, otherwise 0. UInt8

Examples

Usage example

notEquals

Introduced in: v1.1

Syntax

Arguments

  • a — First value.*
  • b — Second value.*

Returned value

Returns 1 if a is not equal to b, otherwise 0. UInt8

Examples

Usage example