美文网首页
MySQL 正则表达式

MySQL 正则表达式

作者: 米茶饿了 | 来源:发表于2018-08-10 16:52 被阅读0次

    原文地址: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;

    复合查询1

    mysql> select coalesce(name,'总数'),sum(singin) as singin_total,count(*) from employee_tbl group by name e with rollup;

    复合查询2

    mysql> select name,sum(singin) as singin_total,count(*) from employee_tbl where name regexp '^小' group by name ;

    正则匹配1

    mysql> select name,sum(singin) as singin_total,count(*) from employee_tbl where name regexp '明$';

    正则匹配2

    相关文章

      网友评论

          本文标题:MySQL 正则表达式

          本文链接:https://www.haomeiwen.com/subject/cthcbftx.html