LTEQ()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a boolean indicating if one value is less than or equal to another.
USAGE
LTEQ(value, value)
Argument Name | Description |
---|---|
| The two values to compare |
DETAILS
LTEQ()
is a function that checks if the first argument is less than or equal to the second argument and returns 1
(true) or 0
(false).
If at least one value is a number, a numeric comparison is performed. Thus, a string value is converted into a number when paired with a numeric value.
When both values are strings, the comparison takes into account the current sort order, which might treat uppercase and lowercase letters as equivalent.
A NULL
is returned if either argument is NULL
.
The function call LTEQ(x, y)
behaves in exactly the same manner as the conditional expression x <= y
.
EXAMPLES
SELECT LTEQ(99, 123), LTEQ(PI(), 3);
+---------------+---------------+
| LTEQ(99, 123) | LTEQ(PI(), 3) |
+---------------+---------------+
| 1 | 0 |
+---------------+---------------+
-- Disable strict mode or the select might throw an error
SET sql_mode = '';
SELECT LTEQ('99a', 99), LTEQ('99a', '99');
+-----------------+-------------------+
| LTEQ('99a', 99) | LTEQ('99a', '99') |
+-----------------+-------------------+
| 1 | 0 |
+-----------------+-------------------+