Oracle查询以查找不包含字符的字符串 [英] Oracle query to find string not containing characters
本文介绍了Oracle查询以查找不包含字符的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是Oracle查询,它将返回所有记录,其中字段mytable.myname
包含任何个字符其他
What is an Oracle query that will return all records where the field mytable.myname
contains any characters other than
-
A-Z
-
a-z
-
0-9
-
-/\()
A-Z
a-z
0-9
-/\()
推荐答案
您可以使用以下内容:
SELECT * FROM mytable WHERE REGEXP_LIKE (myname, '^[^a-zA-Z0-9\/\\()-]+$');
您还可以使用i
修饰符执行相同的操作:
You can also do the same with an i
modifier:
SELECT * FROM mytable WHERE REGEXP_LIKE (myname, '^[^a-z0-9\/\\()-]+$', 'i');
说明:
-
^
字符串的开头 -
[^___ ]
否定字符集(它将匹配其中指定的字符以外的任何字符) -
+
多次匹配上一个组 -
$
字符串的结尾
^
start of the string[^___ ]
negative character set (which will match any character other than the characters specified inside it)+
match the previous group more than once$
end of the string
这篇关于Oracle查询以查找不包含字符的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文