在Oracle中查找不包含数字数据的行 [英] Finding rows that don't contain numeric data in Oracle
本文介绍了在Oracle中查找不包含数字数据的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在一个非常大的Oracle表中查找一些有问题的记录.该列应包含所有数值数据,即使它是varchar2列也是如此.我需要查找不包含数字数据的记录(当我尝试在此列上调用to_number(col_name)函数时会引发错误).
I am trying to locate some problematic records in a very large Oracle table. The column should contain all numeric data even though it is a varchar2 column. I need to find the records which don't contain numeric data (The to_number(col_name) function throws an error when I try to call it on this column).
推荐答案
我当时想您可以使用regexp_like条件,并使用正则表达式查找任何非数字.我希望这会有所帮助吗?!
I was thinking you could use a regexp_like condition and use the regular expression to find any non-numerics. I hope this might help?!
SELECT * FROM table_with_column_to_search WHERE REGEXP_LIKE(varchar_col_with_non_numerics, '[^0-9]+');
这篇关于在Oracle中查找不包含数字数据的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文