Home > Database > Mysql Tutorial > body text

mysql 5.0存储过程学习总结

WBOY
Release: 2016-06-07 15:03:34
Original
1059 people have browsed it

mysql存储过程学习总结-操作符 算术运算符 加 SET var1=22; 4 - 减 SET var2=3-2; 1 *乘 SET var3=3*2; 6 / 除 SET var4=10/3; 3.3333 DIV 整除SET var5=10 DIV 3; 3 % 取模SET var6=10%3 ; 1 比较运算符 大于12False 小于21False = 小于等于2=2True = 大于

mysql存储过程学习总结-操作符

算术运算符

+     加   SET var1=2+2;       4
-     减   SET var2=3-2;       1
*     乘   SET var3=3*2;       6
/     除   SET var4=10/3;      3.3333
DIV   整除 SET var5=10 DIV 3;  3
%     取模 SET var6=10%3 ;     1

比较运算符


>            大于 1>2 False
>=           大于等于 3>=2 True
BETWEEN      在两值之间 5 BETWEEN 1 AND 10 True
NOT BETWEEN  不在两值之间 5 NOT BETWEEN 1 AND 10 False
IN           在集合中 5 IN (1,2,3,4) False
NOT IN       不在集合中 5 NOT IN (1,2,3,4) True
=            等于 2=3 False
, !=       不等于 23 False
          严格比较两个NULL值是否相等 NULLNULL True
LIKE         简单模式匹配 "Guy Harrison" LIKE "Guy%" True
REGEXP       正则式匹配 "Guy Harrison" REGEXP "[Gg]reg" False
IS NULL      为空 0 IS NULL False
IS NOT NULL  不为空 0 IS NOT NULL True



逻辑运算符

(AND)





AND

TRUE

FALSE

NULL

TRUE

TRUE

FALSE

NULL

FALSE

FALSE

FALSE

NULL

NULL

NULL

NULL

NULL

或(OR)


OR

TRUE

FALSE

NULL

TRUE

TRUE

TRUE

TRUE

FALSE

TRUE

FALSE

NULL

NULL

TRUE

NULL

NULL


异或(XOR)


XOR

TRUE

FALSE

NULL

TRUE

FALSE

TRUE

NULL

FALSE

TRUE

FALSE

NULL

NULL

NULL

NULL

NULL



位运算符

|   位或
&   位与
>>  右移位
~   位非(单目运算,按位取反)


 
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template