//往學生表中插入內容
insert into pm_stu values('1','張三');
insert into pm_stu values('2','李四');
insert into pm_stu values('3','王五');
insert into pm_stu values('4','趙六');
//往選課表中插入內容
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','趙六');
//往選課表中插入內容
insert into pm_ci values('1','1,2,3,4,');
insert into pm_ci values('2','1,4');
select ci_id,wm_concat(stu_name) stu_name
from (select c.ci_id,s.stu_name
from pm_ci c,pm_stu s
where instr(c.stu_ids,s.stu_id)>0)
group by ci_id
order by ci_id;
from (select c.ci_id,s.stu_name
from pm_ci c,pm_stu s
where instr(c.stu_ids,s.stu_id)>0)
group by ci_id
order by ci_id;