我正在尝试检查oracle中包含大写和小写字母的字段, 所以我有这个代码
Select Column
From TABLE
WHERE Column NOT LIKE '%ABC%' AND Column NOT LIKE '%abc%'
有一种更有效的方法可以用来检查一个LIKE语句中的大写和小写字母吗?
答案 0 :(得分:3)
如何大写它:
where upper(column) not like '%ABC%'
答案 1 :(得分:0)
怎么样?
WITH test
AS (SELECT 'aaa' TEXT FROM DUAL
UNION ALL
SELECT 'AaA' FROM DUAL
UNION ALL
SELECT 'aAA' FROM dual
UNION ALL
SELECT 'AAA' FROM DUAL)
SELECT *
FROM test
WHERE text != DECODE(SUBSTR(LOWER(text),1,1),SUBSTR(text,1,1), LOWER(text), UPPER(text));