Oracle-选择字段具有小写字符的位置 [英] Oracle - Select where field has lowercase characters

查看:142
本文介绍了Oracle-选择字段具有小写字符的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Oracle 9.2.0.6数据库中有一个用户表.其中两个字段是varchar-last_name和first_name.

I have a table, users, in an Oracle 9.2.0.6 database. Two of the fields are varchar - last_name and first_name.

当将行插入到该表中时,名字和姓氏字段应该全部用大写字母表示,但是不知何故,这两个字段中的某些值是大小写混合的.

When rows are inserted into this table, the first name and last name fields are supposed to be in all upper case, but somehow some values in these two fields are mixed case.

我想运行一个查询,该查询将向我显示表中所有具有小写字符的名字或姓氏的行.

I want to run a query that will show me all of the rows in the table that have first or last names with lowercase characters in it.

我在网上搜索并发现了REGEXP_LIKE,但这必须适用于较新版本的oracle-它似乎对我不起作用.

I searched the net and found REGEXP_LIKE, but that must be for newer versions of oracle - it doesn't seem to work for me.

我尝试的另一件事是将"abcde ... z"翻译为"$$$$$ ... $",然后在我的字段中搜索"$",但是必须有更好的方法吗?

Another thing I tried was to translate "abcde...z" to "$$$$$...$" and then search for a '$' in my field, but there has to be a better way?

提前谢谢!

推荐答案

这是怎么回事:

select id, first, last from mytable
where first != upper(first) or last != upper(last);

这篇关于Oracle-选择字段具有小写字符的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆