Mysql函数
![](https://i-blog.csdnimg.cn/blog_migrate/32f4cde90d7ae49a5ed00ac62226d49b.png)
Concat 和Concat_ws()函数
使用concat来进行字符之间的连接![](https://i-blog.csdnimg.cn/blog_migrate/2805c5981fb1532592ac1b729c878774.png)
![](https://i-blog.csdnimg.cn/blog_migrate/642d5aaa54bbb88ac7df327ff985ced7.png)
对数据表两个字段之间的内容进行连接
Select concat (first_name ,last_name) as fullname from test;
![](https://i-blog.csdnimg.cn/blog_migrate/4d54a17fcf9eec518a2614562593098e.png)
使用Concat_ws()函数指定分隔符来进行字符连接。
Select concat_ws(”*”,”你好”,”中国”,”人民”);
Format函数
使用format函数来进行数字格式化。例:Select format (131452074.002,2);
![](https://i-blog.csdnimg.cn/blog_migrate/c2ff5d574819594356b76a2e70226953.png)
Lower和upper函数
进行字符之间的大小写转换
![](https://i-blog.csdnimg.cn/blog_migrate/1760b0026c2a424b65323cce4feea188.png)
![](https://i-blog.csdnimg.cn/blog_migrate/f8f362310acc5d2751e2bfcfb08bdcea.png)
Left和right函数
使用left和right函数进行左右两侧字符获取。
![](https://i-blog.csdnimg.cn/blog_migrate/027cab680e215c3b68ea703e57f38b2a.png)
![](https://i-blog.csdnimg.cn/blog_migrate/a65e92c12ff47b20740d7fc2317338fd.png)
![](https://i-blog.csdnimg.cn/blog_migrate/b669b098d128d1c92e224fa409cd70bc.png)
![](https://i-blog.csdnimg.cn/blog_migrate/433ba8e242ca828fd15ea19ee261afac.png)
Length()函数
Select length(“mysql”);
LTRIM、RTRIM、REPLACE和TRIM函数
Select ltrim(” mysql ”);
![](https://i-blog.csdnimg.cn/blog_migrate/86cbe4475ab3bf018cf74bd8056dec77.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e25089d0bbbd65150da484325b106953.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e2f32eeb7df73c40f902772a6b6253ca.png)
![](https://i-blog.csdnimg.cn/blog_migrate/744d1f86005526213c321c850f9a0c4b.png)
![](https://i-blog.csdnimg.cn/blog_migrate/921e1e9f748c97d670cc7c3151408738.png)
![](https://i-blog.csdnimg.cn/blog_migrate/ed8c28e432d71bb2db484919e4443967.png)
![](https://i-blog.csdnimg.cn/blog_migrate/03461da1698de02652be84ebba64cefc.png)
Substring和[not] like函数
字符串截取:substring。 Select substring(“msqyl”,-2);
[not] like函数:模式匹配
![](https://i-blog.csdnimg.cn/blog_migrate/d60854e6256178a907712c35c45580b1.png)
数值运算符与函数
Select ceil(3.01);
Select floor(3.90);
Select 2 div 4;
Select 5 mod 3;
比较运算符与函数
Between…and、in和is null函数
Select 22 between 0and33;
日期时间函数
信息函数
聚合函数
只有一个返回值的函数。
加密函数