前期我讲解了mysql的基础命令及Select常规用法,本节就讲解一下运算符和常规函数的讲解及实例;


Mysql运算符:
- 数学运算符:(加+、减-、乘*、除/、取余%)实例:

- 比较运算符:(=、!=、>、>=、、between_and_、not between / in、not in、like、regexp、rlike、null、is not null)
实例:

其他诸如此类比较,0为false(错误),1为true(正确)
between—and——(两者之间)/not between ——and——(不在两者之间)
in(包含的意思)/not in(不包含的意思)

like (模糊匹配,相似的意思)

regexp/rlike (正则表达式)

null(空值)/ is not null(不是空值)

- 逻辑运算符:(and且/与、or或、not逻辑非 、xor逻辑异或)

在这仅讲常用的;
运算符的优先级:

常用的通配符
所谓通配符,就是指在检索的时候,可以用特定的符号代码字符,便于快速模糊查询或检索;
- 常用的通配符有哪些呢:
- 1:%用法%代表零及以上个字符,例如:%s代码以s结尾: wws/ws/s,相符亦然;
- _ 下滑线用法_下滑线代表,一个字符,例如:_t,只能检索以t结尾的两个字符:et/st;
- [a b c]中括号用法指在包含限定的字符;
- [^a b c]用法指不包含指定字符;