结果是出来了,但不知是否有BUG,总感觉哪里有问题

来源:5-5 练习

C_plus

2018-07-15 18:35

col 课程号 format a5
col 选课名单 format a20
select c.ci_id 课程号,wm_concat(s.stu_name) 选课名单
from pm_ci c,pm_stu s
where instr(c.stu_ids,s.stu_id)>0
group by c.ci_id;

踏破铁鞋无觅处,蓦然回首,答案就在灯火阑珊处

写回答 关注

1回答

  • 呜呜呜呜喵王
    2018-08-17 19:42:29

    select p.ci_id,max(stu_name) as STU_NAME
    from (select c.ci_id,wm_concat(s.stu_name) 
    over(partition BY c.stu_ids order by s.stu_id) as stu_name
    from pm_ci c,pm_stu s
    where instr(c.stu_ids,s.stu_id) > 0) p 
    group by p.ci_id

    查询出来后有排序效果的..

Oracle高级查询

数据库开发中应用广泛的高级查询,本教程通过大量的案例详细讲解

62974 学习 · 147 问题

查看课程

相似问题