select
(select ename from emp where emp.deptno= d.deptno) ename
from dept d where d.deptno=10
这样ename会返回多个结果,想把他们拼接在一起,有什么办法吗?
------解决方案--------------------
- SQL code
SQL> select deptno, wm_concat(ename) wm from emp where deptno=10 group by deptno; DEPTNO WM ---------- -------------------------------------------------- 10 Clark,Miller,King
------解决方案--------------------
- SQL code
select deptno, wm_concat(ename) from emp group by deptno having deptno=10;