Declaration
INTERVAL(N,N1,N2,N3,...)
Description
Returns the comparison result of N with the list N1,N2,... composed of other parameters. In this document, N~1~, N~2~,...., and N~n~ represent the parameters N1,N2...,Nn respectively.
Compare N with N to n in turn:
If
NisNULL, returnNULL.If
Nis less than N~1~, then return 0.If there exists a positive integer (n) such that for any positive integer (m \leq n), (N_m \geq N) but (N < N_{n + 1}), then return (n).(If (N_m) is
NULL, then (N) is also considered to be greater than or equal to (N_m)).
Examples
obclient> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);
+--------------------------------------+
| INTERVAL(23, 1, 15, 17, 30, 44, 200) |
+--------------------------------------+
| 3 |
+--------------------------------------+
1 row in set
obclient> SELECT INTERVAL(23, 1, 15, 17, NULL, 44, 200);
+----------------------------------------+
| INTERVAL(23, 1, 15, 17, NULL, 44, 200) |
+----------------------------------------+
| 4 |
+----------------------------------------+
1 row in set
obclient> SELECT INTERVAL(23, 1, 15, 17, 30, 17, 200);
+--------------------------------------+
| INTERVAL(23, 1, 15, 17, 30, 17, 200) |
+--------------------------------------+
| 3 |
+--------------------------------------+
1 row in set