ClickHouse/docs/en/sql-reference/functions/comparison-functions.md
Ivan Blinkov ffe2cecb1b
[docs] split the ALTER article (#12502)
* initial split

* initial adjust links

* make en buildable

* re-normalize
2020-07-15 00:02:41 +03:00

1023 B
Raw Blame History

toc_priority toc_title
36 Comparison

Comparison Functions

Comparison functions always return 0 or 1 (Uint8).

The following types can be compared:

  • numbers
  • strings and fixed strings
  • dates
  • dates with times

within each group, but not between different groups.

For example, you cant compare a date with a string. You have to use a function to convert the string to a date, or vice versa.

Strings are compared by bytes. A shorter string is smaller than all strings that start with it and that contain at least one more character.

equals, a = b and a == b operator

notEquals, a != b and a <> b operator

less, < operator

greater, > operator

lessOrEquals, <= operator

greaterOrEquals, >= operator

Original article