MySQL支持多种类型的运算符,这些运算符能够用来连接表达式,这些运算符包括:mysql
select 0.1+0.333,0.1-0.3333,1/2,1%2;复制代码
#between and
SELECT 10 BETWEEN 10 AND 20,
9 BETWEEN 10 AND 20;
#like
SELECT 123456 LIKE '123%',
123456 LIKE '%123%',
123456 LIKE '%321%';
#regexp
select 'abcdef' regexp 'ab',
'abcdefg' regexp 'k';复制代码
#not
select not 0,not 1,not null;
#and
select (1 and 1),(0 and 1),(3 and 1),(1 and null);
#or,xor(异或)同上使用复制代码
select 2&3,2&3&4,2|3,2^3,~1;复制代码
仍一张图做为总结:
sql