求高人指教,统计后三位相同的号码的sql怎么写? 数据库中的表有一列存的是号码,现在要求查出后三位相同的号码,例如1234666这种,请高人指教! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from 表名 where mod(substr(id,length(id)-2,3),111)=0; substr(id,length(id)-2,3) 这个就是取后三位的,前面有字符,只要后三位是纯数字就没问题后三位要考虑字符吗? with t as (select 'ad2188882138888' str from dual union all select '11' from dual union all select '2333' from dual)select * from t where regexp_count(substr(str, -3), substr(str, -1)) = 3 and regexp_count(substr(str, -4), substr(str, -1)) <> 4 !!!!求助,如何在PL/SQL里面使用动态的二维数组。 急求Oracle培训PPT文档 JDBC链接ORACLE的问题 where条件里的and or 简单而怪异的存储过程问题,谢谢各位高手! 触发器问题 谁来救我,试了都有问题??急急急 请教大家,怎么能用导出的sql文件在access中导入数据呢 关于Oracle的数据类型问题? sqlserver存储过程转oralce存储过程的问题求助,在线等 oracle乱码问题 求个sql??
select * from 表名 where mod(substr(id,length(id)-2,3),111)=0;
后三位要考虑字符吗?
(select 'ad2188882138888' str
from dual
union all
select '11'
from dual
union all
select '2333' from dual)
select *
from t
where regexp_count(substr(str, -3), substr(str, -1)) = 3
and regexp_count(substr(str, -4), substr(str, -1)) <> 4