大侠进:oracle汉字匹配(急) 现在新涉及一个项目,需要对汉字进行匹配。例如:“北京航空航天大学”和“北京航天”匹配原始数据为id content1 北京航空航天大学2 北京航天查询出表中想上面所有类似的数据 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可能是没有描述清楚:表:table字段:id,content内容:1 赛爱电解专卖店2 赛爱电解生成器专卖店3 赛爱离子水机店4 赛安服饰安服饰饰大楼5 北京航空航天大学 6 北京航天7 佐登妮丝美容化妆品有限公司8 越秀区佐登妮丝流花美容院9 佐登妮丝国际美容连锁机构10 佐登妮丝有限公司11 佐登妮丝广州美容化妆品有限公司查询结果要为通过“佐登妮丝”,“赛爱电解”等等。这样匹配显示出查询结果 baidu内容: oracle 全文检索 怎么这么复杂?LZ是不是想要select * from table where context like '*检索字段*'; 简单点考虑, LIKE就足够. ORACLE全文检索技术可以提高速度. 谢谢各位了。根据业务需求是要求对每个字符进行匹配,以下是根据网上的改动下的函数,但效率很不理想,请高人给点意见create or replace function fun_match_cnt(p_str varchar2, p_str2 varchar2) return varchar2 is v_mother varchar2(200); v_match varchar2(20); v_lenm number ; v_num number := 0; v_cnt number; v_mateched varchar2(200) := ' ';begin v_cnt := 0; v_mother := p_str; v_lenm := length(p_str2) ; for y in 1 .. v_lenm loop v_match := substr(p_str2, y , 1); select sign(instr(v_mother, v_match)) into v_num from dual; if v_num = 1 then v_mateched := trim(v_mateched || v_match); select substr(v_mother, 1, instr(v_mother, v_match) - 1) || substr(v_mother, instr(v_mother, v_match) + 1) into v_mother from dual; v_cnt := v_cnt + v_num; --v_cnt := v_cnt + fun_match_cnt(v_mother,v_match); v_mateched := trim(v_mateched || nvl(fun_match_cnt(v_mother, v_match), ' ')); end if; end loop; ---dbms_output.put_line(v_cnt); -- return v_cnt; return trim(v_mateched);end; 楼主,我帮你完成好了,把数据给我,当天就可以给你结果,保证让你满意。请联系我:[email protected] Linux下的Oracle数据库不能连接问题 oracle正在初始化或在关闭,请稍后再试。 oracle查询语句求解 字符串截取 弱弱的问句!~查询oracle中所有数据库的名字,请大哥给写个sql..小弟实在是想不起来了. 安装Oracle10g时候遇到的问题,急……请大家赐教~ 请问实体关系图中一对多关系,多对多关系,一对一关系反映在具体的表之间是怎么样具体表现的呢? 请问:如何将ORACLE9I中的表和数据导出到8I? 关于max和group by组合使用的疑问! oracle的安装问题 Oracle sql语句报错,高手请看 请教一条Oralle的sql语句怎么写
表:table
字段:id,content
内容:
1 赛爱电解专卖店
2 赛爱电解生成器专卖店
3 赛爱离子水机店
4 赛安服饰安服饰饰大楼
5 北京航空航天大学
6 北京航天
7 佐登妮丝美容化妆品有限公司
8 越秀区佐登妮丝流花美容院
9 佐登妮丝国际美容连锁机构
10 佐登妮丝有限公司
11 佐登妮丝广州美容化妆品有限公司
查询结果要为通过“佐登妮丝”,“赛爱电解”等等。这样匹配
显示出查询结果
select * from table where context like '*检索字段*';
create or replace function fun_match_cnt(p_str varchar2, p_str2 varchar2)
return varchar2 is
v_mother varchar2(200);
v_match varchar2(20);
v_lenm number ;
v_num number := 0;
v_cnt number;
v_mateched varchar2(200) := ' ';
begin
v_cnt := 0;
v_mother := p_str;
v_lenm := length(p_str2) ;
for y in 1 .. v_lenm loop
v_match := substr(p_str2, y , 1);
select sign(instr(v_mother, v_match)) into v_num from dual;
if v_num = 1 then
v_mateched := trim(v_mateched || v_match);
select substr(v_mother, 1, instr(v_mother, v_match) - 1) ||
substr(v_mother, instr(v_mother, v_match) + 1)
into v_mother
from dual;
v_cnt := v_cnt + v_num;
--v_cnt := v_cnt + fun_match_cnt(v_mother,v_match);
v_mateched := trim(v_mateched ||
nvl(fun_match_cnt(v_mother, v_match), ' '));
end if;
end loop;
---dbms_output.put_line(v_cnt);
-- return v_cnt;
return trim(v_mateched);
end;
请联系我:[email protected]