比30号部门任意一人工资高的人信息 为什么查30号部门工资最少的人 不应该比最大的人工资高就比任意一个人都工资高吗 我想不明白了 谁能帮帮我
2019-11-11
select c.ci_id 学号, wm_concat(decode(instr(c.stu_ids, s.stu_id), 0, '',s.stu_name) ) 选课列表
from pm_ci c, pm_stu s
group by c.ci_id;
from pm_ci c, pm_stu s
group by c.ci_id;
SELECT *
FROM (SELECT rownum r,empno,ename,sal
FROM (SELECT rownum,empno,ename,sal FROM emp ORDER BY sal DESC ) e1
WHERE rownum <=4) e2
WHERE r>=1;
最外面一次取值直接用*就可以了吧
FROM (SELECT rownum r,empno,ename,sal
FROM (SELECT rownum,empno,ename,sal FROM emp ORDER BY sal DESC ) e1
WHERE rownum <=4) e2
WHERE r>=1;
最外面一次取值直接用*就可以了吧
select c.CI_ID,wm_concat(s.stu_name)STU_NAME from
PM_CI c join PM_STU s
on instr(c.stu_ids,s.stu_id)>0
group by c.ci_id;
CI_ID STU_NAME
1 张三,赵六,王五,李四
2 2 张三,赵六
PM_CI c join PM_STU s
on instr(c.stu_ids,s.stu_id)>0
group by c.ci_id;
CI_ID STU_NAME
1 张三,赵六,王五,李四
2 2 张三,赵六
select t.ci_id, (select wm_concat(STU_NAME) from PM_STU t1
where instr(STU_IDS,t1.stu_id)>0) STU_NAME from PM_CI t
where instr(STU_IDS,t1.stu_id)>0) STU_NAME from PM_CI t
--答案
select c.ci_id,wm_concat(s.stu_name)
from pm_ci c left join pm_stu s on
instr(c.stu_ids,s.stu_id)>0 group by c.ci_id;
select c.ci_id,wm_concat(s.stu_name)
from pm_ci c left join pm_stu s on
instr(c.stu_ids,s.stu_id)>0 group by c.ci_id;