2.正则表达式函数 REGEXP_SUBSTR 处理,将数据进行过滤,ok!
-- 条件语句: where REGEXP_SUBSTR(t1.operatorid, ‘ [0-9]+ ‘ ) IS NOT NULL -- 示例: select t1.operatorid,t2.equ_group, max (last_login) last_login from 表 t1, ( select t1.equ_group, t2.locationid from 表 t1,表 t2 where t2.equ_id = t1.id)t2 where t1.eqpid = t2.locationid and REGEXP_SUBSTR(t1.operatorid, ‘ [0-9]+ ‘ ) IS NOT NULL group by t1.operatorid,t2.equ_group
3.扩展:
正则表达式函数 REGEXP_SUBSTR,有5个参数,分别是:
-- example: SELECT REGEXP_SUBSTR( ‘ ABC123BCD456 ‘ , ‘ [0-9]+ ‘ ) FROM DUAL; -- 返回123 SELECT REGEXP_SUBSTR( ‘ ABC123BCD456 ‘ , ‘ [0-9]+ ‘ , 6 ) FROM DUAL; -- 返回3 SELECT REGEXP_SUBSTR( ‘ ABC123BCD456 ‘ , ‘ [0-9]+ ‘ , 7 ) FROM DUAL; -- 返回456 SELECT REGEXP_SUBSTR( ‘ ABC123BCD456 ‘ , ‘ [0-9]+ ‘ , 1 , 2 ) FROM DUAL; -- 返回456
translate函数,语法是TRANSLATE(string,from_str,to_str),其功能是返回将(所有出现的)from_str中的每个字符替换为to_str中的相应字符以后的string。
-- 语法: select translate( ‘ 字段 ‘ , ‘ 0123456789 ‘ || ‘ 字段 ‘ , ‘ 0123456789 ‘ ) from 表; -- example: select translate( ‘ sdgub1235sdhau ‘ , ‘ 0123456789 ‘ || ‘ sdgub1235sdhau ‘ , ‘ 0123456789 ‘ ) from dual -- 输出: -- 1235
oracle sql表联合报错invalid number,筛出字段中的数值集合
标签:bst 数据集 col sql abc || ast 大小写 acl
查看更多关于oracle sql表联合报错invalid number,筛出字段中的数值集合的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did117245