select * from (select * from emp order by sal desc)where rownum<=3这样也是可以的
2018-08-22
拿走,不谢,已测试通过
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 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,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
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),只有点开后面的省略号才能看到字符串值,求解答
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 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
2018-05-27
select deptno,listagg(ename,',') within group (order by deptno) enameList from emp group by deptno;
2018-05-16