有以下声明:
WITH tokenkeys
as
(
select regexp_substr('A set of words from other side','[^ ]+', 1, level) WORDSPLIT from dual
connect by regexp_substr('A set of words from other side', '[^ ]+', 1, level) is not null
)
select * from tokenkeys
它输出如下表:
|WORDSPLIT|
|A |
|set |
|of |
|words |
|from |
|other |
|side |
我想在 where/in 语句中使用这个临时集合:
WITH tokenkeys
as
(
select regexp_substr('A set of words from other side','[^ ]+', 1, level) WORDSPLIT from dual
connect by regexp_substr('A set of words from other side', '[^ ]+', 1, level) is not null
)
select p.* from people p
where
p.name in (tokenkeys.wordsplit)
or UTL_MATCH.EDIT_DISTANCE_SIMILARITY(p.lastname, tokenkeys.wordsplit) > 60 ???
or ....
我有两个问题:
- 怎么办
p.name in (tokenkeys.wordsplit)
? - 如何将临时集合与 edit_distance_similarity 函数混合,并获得最大结果:
例子:
UTL_MATCH.EDIT_DISTANCE_SIMILARITY(p.lastname, tokenkeys.wordsplit) > 60
//I want the greater
max(UTL_MATCH.EDIT_DISTANCE_SIMILARITY(p.lastname, tokenkeys.wordsplit))
//I can't yet test this line.
非常感谢。