Mysql rlike 正则

1. 表内容:

 

2. 查询姓名以贾开头的员工

select * from emp_info a where a.ename rlike '^贾.*' ;

 

 

 

3. 查询姓名以张开头,以疯结尾的 员工:

select * from emp_info a where a.ename rlike '^张.*疯$' ;

 

 

posted @ 2021-07-14 23:30  Avicii_2018  阅读(264)  评论(0)    收藏  举报