select deptno,avg(sal)
from emp group by deptno
having avg(sal) =
(select max(avg(sal)) from emp group by deptno);
from emp group by deptno
having avg(sal) =
(select max(avg(sal)) from emp group by deptno);
2018-02-19
SELECT CI_ID,WM_CONCAT(STU_NAME)
FROM ( SELECT A.CI_ID,B.STU_NAME
FROM PM_CI A, PM_STU B WHERE INSTR(A.STU_IDS,B.STU_ID)>0)
GROUP BY CI_ID
FROM ( SELECT A.CI_ID,B.STU_NAME
FROM PM_CI A, PM_STU B WHERE INSTR(A.STU_IDS,B.STU_ID)>0)
GROUP BY CI_ID
2018-01-10
select t.ci_id, wm_concat(stu_name)
from pm_ci t ,pm_stu d
where instr(t.stu_ids,d.stu_id)>0
group by t.ci_id
from pm_ci t ,pm_stu d
where instr(t.stu_ids,d.stu_id)>0
group by t.ci_id
2017-12-26
--查詢語句
select c.CI_ID,WM_CONCAT(s.STU_NAME) STU_NAME
from pm_ci c,PM_STU s
where instr(c.STU_IDS,s.STU_ID)>0
GROUP BY c.CI_ID
select c.CI_ID,WM_CONCAT(s.STU_NAME) STU_NAME
from pm_ci c,PM_STU s
where instr(c.STU_IDS,s.STU_ID)>0
GROUP BY c.CI_ID
2017-12-14