【发布时间】:2014-08-17 09:20:56
【问题描述】:
select regexp_substr('select count(distinct empno), count(distinct deptno) from emp',
'count\(distinct.*\)')
from dual;
对于上面的查询,我想要输出count(distinct empno),但是上面查询中的“.*”是最后一次出现的“)”而不是第一次出现。
谁能告诉我如何得到我想要的输出?
【问题讨论】:
-
使用非贪婪表达式
.*?而不是.* -
我不知道为什么相同的答案。
标签: sql regex oracle oracle11g