如何得到两个字符串长度只相差一位,并且一个字符串所含的字符是另一个字符串的字符的一个子集。
‘mold’,‘mould’这两个字符串就满足要求。
‘mold’,‘mould’这两个字符串就满足要求。
解决方案 »
- oracle联合查询后的排序问题
- plsqldevelop 快捷键不能用了
- utl_file.fopen中的三种打开模式a/r/w的问题
- 各位 大哥大姐们...oracle 11G的 enterprise manager console 在哪里???
- ORACLE中,我在DOS下连接数据库A....
- oracle数据库好像坏掉了。。。。。高手请进啊???分数没有关系。先100
- 高手请进,关于sql*plus的登录问题
- 如何导入数据
- 为何最后输出两个一样的记录啊?
- 100分求Clob存取完整源码,急!急!急!!!
- 关于Oracle,行rownum控制的问题
- execute immediate 执行出错。
or str2 like str1||'_' or str2 like '_'||str1
....
去掉了空格。
from (select Str
from (select substr('&Short',level,1) Str
from dual
connect by substr('&Short',level,1) is not null)
where Str IN
(select substr('&Long',level,1)
from dual
connect by substr('&Long',level,1) is not null))
having count(1) = length('&Short')
and length('&Long') - length('&Short') = 1;
由于一个为另一个的子集,且长度差1,那么用模糊匹配的_就行了,多出来的那个字符可能在左,也可能在右
第二行的2个or,是因为没有指定长的那个字符串是str1,还是str2