ClickHouse/docs/en/sql-reference/functions/comparison-functions.md
Ivan Blinkov d91c97d15d
[docs] replace underscores with hyphens (#10606)
* Replace underscores with hyphens

* remove temporary code

* fix style check

* fix collapse
2020-04-30 21:19:18 +03:00

36 lines
1023 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
toc_priority: 36
toc_title: Comparison
---
# 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 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 {#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-->