comparison-functions.md 912 字节
Newer Older
I
Ivan Blinkov 已提交
1 2 3 4 5
---
toc_priority: 36
toc_title: Comparison
---

6
# Comparison Functions {#comparison-functions}
7 8 9 10 11

Comparison functions always return 0 or 1 (Uint8).

The following types can be compared:

12 13 14 15
-   numbers
-   strings and fixed strings
-   dates
-   dates with times
16 17 18

within each group, but not between different groups.

19
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.
20 21 22

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.

I
Ivan Blinkov 已提交
23
## equals, a = b and a == b operator {#function-equals}
24

25
## notEquals, a != b and a \<\> b operator {#function-notequals}
26

27
## less, \< operator {#function-less}
28

29
## greater, \> operator {#function-greater}
30

31
## lessOrEquals, \<= operator {#function-lessorequals}
32

33
## greaterOrEquals, \>= operator {#function-greaterorequals}
34