我有下表和数据:
- 1)我只想显示句子的最后一部分。
- 2)从句尾删除任何单个字符。
- 3) 从词尾删除和特殊字符,如 -,#,?,_
create table t1 (id number(9) , words varchar2(20)); insert into t1 values(1,'hello UK'); insert into t1 values(2,'hello Eypt'); insert into t1 values(3,'hello ALL'); insert into t1 values(4,'hello I'); insert into t1 values(5,'hello USA'); insert into t1 values(6,'hello #'); insert into t1 values(7,'hello #'); insert into t1 values(8,'hello A'); insert into t1 values(9,'hello 20'); insert into t1 values(10,'hello 2-2-2010');
我用过这个
select REGEXP_SUBSTR(words,'\S+$)from t1;
预期成绩
id word 1 UK 2 EGYPT 3 ALL 5 USA 9 20 10 2-2-2010