mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-09 18:10:48 +00:00
2e1f6bc56d
* replace exit with assert in test_single_page * improve save_raw_single_page docs option * More grammar fixes * "Built from" link in new tab * fix mistype * Example of include in docs * add anchor to meeting form * Draft of translation helper * WIP on translation helper * Replace some fa docs content with machine translation * add normalize-en-markdown.sh * normalize some en markdown * normalize some en markdown * admonition support * normalize * normalize * normalize * support wide tables * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * normalize * lightly edited machine translation of introdpection.md * lightly edited machhine translation of lazy.md * WIP on translation utils * Normalize ru docs * Normalize other languages * some fixes * WIP on normalize/translate tools * add requirements.txt * [experimental] add es docs language as machine translated draft * remove duplicate script * Back to wider tab-stop (narrow renders not so well)
33 lines
1.2 KiB
Markdown
33 lines
1.2 KiB
Markdown
# Comparison functions {#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 can’t 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.
|
||
|
||
Note. Up until version 1.1.54134, signed and unsigned numbers were compared the same way as in C++. In other words, you could get an incorrect result in cases like SELECT 9223372036854775807 \> -1. This behavior changed in version 1.1.54134 and is now mathematically correct.
|
||
|
||
## equals, a = b and a == b operator {#function-equals}
|
||
|
||
## notEquals, a ! operator= b and a `<>` b {#function-notequals}
|
||
|
||
## less, `< operator` {#function-less}
|
||
|
||
## greater, `> operator` {#function-greater}
|
||
|
||
## lessOrEquals, `<= operator` {#function-lessorequals}
|
||
|
||
## greaterOrEquals, `>= operator` {#function-greaterorequals}
|
||
|
||
[Original article](https://clickhouse.tech/docs/en/query_language/functions/comparison_functions/) <!--hide-->
|