词类下所有词条信息

/*oracle 存储过程*/

create or replace function GetParentNodeName(leafNode in number) return varchar2 is
  Result varchar2(100);
  i int;
  CompanyOID number;
  tmpSer varchar2(200);
  tmpStr varchar2(50);
  treeName1 varchar2(100);
begin
  select
         t.struid,t.industryname,t.companyoid
         into tmpStr,treeName1,CompanyOID
  from ejsjindustry t where t.oid=leafNode;
  i := length(tmpStr)/3;
  while(i>0)
        loop
           select t1.industryname into tmpSer
           from ejsjindustry t1
           where t1.serialnumber = substr(tmpStr,0,3*i) and t1.companyoid=321;
           Result := tmpSer||'-'||Result;
           i := i -1;
        end loop;
  Result := Result||treeName1;
  return(Result);
end GetParentNodeName;

//统计词类下词条
select
       getparentnodename(t.industryoid) as 三级词类,
       t.industryoid as 子目主键,
       t.chwordname as 中文词条,
       t.enwordname as 英文词条,
       decode(t.wordlevel,1,'一级',2,'二级') as 重要程度,
       decode(t.problemornot,0,'无',1,'有') as 有无疑问,
       t.remark as 同义词,
       t.chwordsimple as 中文简称,
       t.formalname as 相关网址,
       t.enwordab as 缩写,
       t.enworddesc as 商品名,
       t.chemicalname as 化学名,
       t.generatename as 通用名,
       t.lationname as 学名,
       t.complexnumdesc as 特殊复数显示,    
       decode(t.wordfrom,1,'专业词典',2,'法律、法规',3,'专业技术文献',4,'其他') as 资料来源
from ejsjdictionary t,ejsjindustry t1
where 
       t.industryoid(+)=t1.oid and
       t.companyoid=321 and
       t1.serialnumber like '013%' and
       t.status>1 and
       t.status<99
order by t1.industrycode,t.wordlevel,t.chwordname

统计词类下词条个数
select
      t.oid,
      t.industryname,
      t.serialnumber,
      decode(count(*),1,0,count(*)) as dictnum
from ejsjindustry t,ejsjdictionary t1
where
      t.oid=t1.industryoid(+) and
      t.companyoid=321
group by t.industryname,t.serialnumber,t.oid
order by t.industryname,t.serialnumber,t.oid

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值