原文地址:http://www.runoob.com/mysql/mysql-regexp.html
mysql> select coalesce(name,'总数'), count(*),sum(singin) as singin_total from employee_tbl group by namme with rollup;
![](https://img.haomeiwen.com/i10745383/2f4f0a010ccc69e1.png)
mysql> select coalesce(name,'总数'),sum(singin) as singin_total,count(*) from employee_tbl group by name e with rollup;
![](https://img.haomeiwen.com/i10745383/43fc925f8ef6d1d7.png)
mysql> select name,sum(singin) as singin_total,count(*) from employee_tbl where name regexp '^小' group by name ;
![](https://img.haomeiwen.com/i10745383/2306c79267134e2c.png)
mysql> select name,sum(singin) as singin_total,count(*) from employee_tbl where name regexp '明$';
![](https://img.haomeiwen.com/i10745383/42441ff1de0ba1d6.png)
网友评论