<=
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Operators for MariaDB Xpand
Topics on this page:
Overview
Less than or equal to.
USAGE
value1 <= value2
Value Name | Description |
---|---|
| The two values to compare |
DETAILS
The <=
operator checks if the first value is less than or equal to the second value 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 value is NULL
.
The conditional expression x <= y
behaves in exactly the same manner as the function call LTEQ(x, y)
.
EXAMPLES
SELECT 99 <= 123, PI() <= 3;
+-----------+-----------+
| 99 <= 123 | PI() <= 3 |
+-----------+-----------+
| 1 | 0 |
+-----------+-----------+
-- Disable strict mode or the comparison might throw an error
SET sql_mode = '';
SELECT '99a' <= 99, '99a' <= '99';
+-------------+---------------+
| '99a' <= 99 | '99a' <= '99' |
+-------------+---------------+
| 1 | 0 |
+-------------+---------------+