为了账号安全,请及时绑定邮箱和手机立即绑定

Oracle高级查询

select * from (select * from emp order by sal desc)where rownum<=3这样也是可以的
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

查询出来后有排序效果的
是的说的很对
你要说where时还没执行分组我倒还能理解
讲的生动有趣,比较详细,谢谢老师
拿走,不谢,已测试通过
select t3.ci_id as CI_ID,
wm_concat(t3.stu_name) as STU_NAME
from
(
select t1.ci_id,t2.stu_name
from pm_ci t1 cross join pm_stu t2
where instr(t1.stu_ids,t2.stu_id)>0
) t3
group by t3.ci_id;
select ci_id,wm_concat(stu_name) stu_name
from pn_ci a,pm_stu b
where instr(stu_ids,stu_id)>0
group by ci_id;
专家讲课,化繁为简
select c.ci_id,wm_concat(s.stu_name) stu_name
from pm_ci c left outer
join pm_stu s on c.stu_ids=s.stu_id
group by c.ci_id;
SELECT CI_ID,TO_CHAR(WM_CONCAT(STU_NAME)) STU_NAMES
FROM (SELECT * FROM PM_CI,PM_STU
WHERE INSTR(STU_IDS,STU_ID)<>0)
GROUP BY CI_ID
SELECT CI_ID,WM_CONCAT(STU_NAME) STU_NAMES
FROM (SELECT CI_ID,STU_NAME FROM PM_CI,PM_STU
WHERE INSTR(STU_IDS,STU_ID)<>0) GROUP BY CI_ID,结果是正确的,可是出现了一个问题,STU_NAMES字段显示(HUGECLOB),只有点开后面的省略号才能看到字符串值,求解答
--oracle 右连接
Select d.deptno,d.dname,Count(e.empno) from emp e,dept d
Where e.deptno(+) = d.deptno
Group By d.deptno,d.dname

--mysql 右连接
Select d.deptno,d.dname,Count(e.empno)
from emp e Right Join dept d On e.deptno= d.deptno
Group By d.deptno,d.dname
select deptno,listagg(ename,',') within group (order by deptno) enameList from emp group by deptno;
全课程学完了,方言会不少
课程须知
小伙伴们,学习本课程前需要掌握Oracle的语法基础,并且对Oracle的函数有所了解。如不了解这两部分内容,请移步《Oracle数据库开发必备利器之SQL基础》和《Oracle数据库开发利器之函数》两门教程。
老师告诉你能学到什么?
1、掌握分组查询 2、掌握多表查询 3、掌握子查询

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消