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