A || B
concat(A,B)
select 'hello' || 'world'; select "hello" || "world";
select 2 + 3; select 2 - 3; select 2 * 3; select 3 / 2, 3 DIV 2; select 2 % 3,;
/
DIV
rounded
pmod(INT a, INT b)
pmod(DOUBLE a, DOUBLE b)
&
|
^
~
select 1 & 2; select 1 | 2; select 1 ^ 2; select ~ 2;
相等大小判断
= 或 == ,相等
=
==
<=> ,相等
<=>
!= 或 <>,不相等
!=
<>
< ,小于
<
<= ,小于等于
<=
> ,大于
>
>= ,大于等于
>=
是否处于某个范围内
A BETWEEN B AND C
A NOT BETWEEN B AND C
3 个操作对象,只要有一个为 NULL ,则返回 NULL
select 5 BETWEEN 1 AND 5; select "2020-10-01" BETWEEN "2020-09-01" AND "2020-11-01"; select 'a' BETWEEN 'b' AND 'c'; select 'ab' BETWEEN 'aa' AND 'bb'; select 'ab' NOT BETWEEN 'aa' AND 'bb';
是否 NULL
A IS [NOT] NULL
相似与正则
A [NOT] LIKE B
_
%
A RLIKE B
A REGEXP B
是否为 TRUE | FALSE
A IS [NOT] (TRUE|FALSE)
A AND B
A OR B
NOT A
! A
A [NOT] IN (val1, val2, ...)
[NOT] EXISTS (subquery)
参考集合相关函数