oracle 字串拼接

2021-05-25 04:32:19 字數 812 閱讀 9524

create or replace procedure proc_query_prior_department

iscursor department_list_nosub is

select dep.id,dep.name,dep.parent from department dep where  org_id=7;

union_mc varchar2(200);

begin

delete from ma_department_role;

commit;

for vardep in department_list_nosub loop

for cur in (select t.parent,t.name from department t start with t.id=vardep.id connect by prior t.parent =t.id order by t.id asc) loop

if cur.parent is not null then

if(union_mc is null) then

union_mc := cur.name;

else

union_mc :=union_mc||'/'||cur.name;

end if;

end if;

end loop;

insert into ma_department_role(id,name)values(vardep.id,union_mc);

union_mc:=null;

end loop;

commit;

end;

Oracle資料字串拼接

select tablename,ltrim max sys connect by path fieldname,as fields from select tablename,fieldname,rnfirst,lead rnfirst over partition by tablename or...

拼接字串

border 1 class box 標籤名稱th 是否顯示th 標籤順序th tr thead 首頁td class check 是option 否option select td class number 1option 2option 3option 4option 5option 6opti...

字串拼接

給定兩個字串s1和s2,合併成乙個新的字串s。合併規則為,s1的第乙個字元為s的第乙個字元,將s2的最後乙個字元作為s的第二個字元 將s1的第二個字元作為s的第三個字元,將s2的倒數第二個字元作為s的第四個字元,以此類推。包含多組測試資料,每組測試資料報含兩行,代表長度相等的兩個字串s1和s2 僅由...