我有专栏employee_no varchar2(6)
。我想获取所有employee_no
010101
,121212
,232323
等所有记录。如何根据此模式进行搜索?
答案 0 :(得分:1)
您是否正在寻找一组数字重复的员工编号? 如果是这样,那么您可以使用REGEXP_LIKE。
select *
from yourtable
where regexp_like(employeeno, '(..)\1\1');
分解正则表达式,
(..) --matches any two characters
\1 --matches the first group(the one in brackets)
\1 --matches the first group(the one in brackets)
答案 1 :(得分:0)
select * from yourtable where emp_no like '%010101%' OR emp_no like '%121212%' OR
emp_no like '%232323%'