Saturday, April 10, 2010

Oracle SQL query to select only all words in capitals

select * from
(select REGEXP_SUBSTR (ename, '[^ ]+', 1, level) word
from ename
connect by level <= length(regexp_replace(ename,'[^ ]*'))+1 ) where regexp_instr(word,'[A-Z]') > 0;