1 select ci_id, wm_concat(stu_name)
2 from pm_ci pc, pm_stu ps
3 where instr(pc.STU_IDS,ps.stu_id) > 0
4 group by ci_id;
2 from pm_ci pc, pm_stu ps
3 where instr(pc.STU_IDS,ps.stu_id) > 0
4 group by ci_id;
--pm_stu 插入数据
insert into pm_stu values('1','张三');
insert into pm_stu values('2','李四');
insert into pm_stu values('3','王五');
insert into pm_stu values('4','赵六');
--pm_ci 插入数据
insert into pm_ci values('1','1,2,3,4');
insert into pm_ci values('2','1,4');
insert into pm_stu values('1','张三');
insert into pm_stu values('2','李四');
insert into pm_stu values('3','王五');
insert into pm_stu values('4','赵六');
--pm_ci 插入数据
insert into pm_ci values('1','1,2,3,4');
insert into pm_ci values('2','1,4');
--创建pm_stu
create table pm_stu
( stu_id varchar2(20) primary key,
stu_name varchar2(20)
);
--创建pm_ci
create table pm_ci
( ci_id varchar2(20) primary key,
stu_ids varchar2(100)
);
create table pm_stu
( stu_id varchar2(20) primary key,
stu_name varchar2(20)
);
--创建pm_ci
create table pm_ci
( ci_id varchar2(20) primary key,
stu_ids varchar2(100)
);