Operators
Operators can be used for comparing values or for assigning values. There are several operators and they may be used in different SQL statements and clauses. Some can be used somewhat on their own, not within an SQL statement clause.
For comparing values—string or numeric—you can use symbols such as the equal-sign (i.e., =
) or the exclamation point and the equal-sign together (i.e., !=
). You might use these in WHERE
clauses or within a flow-control statement or function (e.g., IF( )). You can also use basic regular expressions with the LIKE
operator.
For assigning values, you can also use the equal-sign or other arithmetic symbols (e.g. plus-sign). You might do this with the SET statement or in a SET
clause in an UPDATE statement.
Other Operators Articles
Title |
Description |
!= |
Not equal operator. |
< |
Less than operator. |
<= |
Less than or equal operator. |
<=> |
NULL-safe equal operator. |
= |
Equal operator. |
> |
Greater than operator. |
>= |
Greater than or equal operator. |
BETWEEN AND |
True if expression between two values. |
COALESCE |
Returns the first non-NULL parameter |
GREATEST |
Returns the largest argument. |
IN |
True if expression equals any of the values in the list |
INTERVAL |
Index of the argument that is less than the first argument |
IS |
Tests whether a boolean is TRUE, FALSE, or UNKNOWN |
IS NOT |
Tests whether a boolean value is not TRUE, FALSE, or UNKNOWN |
IS NOT NULL |
Tests whether a value is not NULL |
IS NULL |
Tests whether a value is NULL |
ISNULL |
Checks if an expression is NULL |
LEAST |
Returns the smallest argument. |
NOT BETWEEN |
Same as NOT (expr BETWEEN min AND max) |
NOT IN |
Same as NOT (expr IN (value,...)) |
Title |
Description |
! |
Logical NOT. |
&& |
Logical AND. |
XOR |
Logical XOR. |
|| |
Logical OR. |
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.