菲小白
2017-08-16 20:48
SQL> select deptno ,wm_concat(ename)from emp group by deptno; DEPTNO ---------- WM_CONCAT(ENAME) -------------------------------------------------------------------------------- 10 CLARK,MILLER,KING 20 SMITH,FORD,ADAMS,SCOTT,JONES 30 ALLEN,JAMES,TURNER,BLAKE,MARTIN,WARD SQL> ed 已写入 file afiedt.buf 1* select deptno 部门号 ,wm_concat(ename) 部门中员工的姓名from emp group by deptno SQL> / select deptno 部门号 ,wm_concat(ename) 部门中员工的姓名from emp group by deptno * 第 1 行出现错误: ORA-00923: 未找到要求的 FROM 关键字 SQL> SQL> ed 已写入 file afiedt.buf 1* select deptno 部门号 ,wm_concat(ename) 部门中员工的姓名from emp group by deptno SQL> select deptno ,wm_concat(ename)from emp group by deptno; DEPTNO ---------- WM_CONCAT(ENAME) -------------------------------------------------------------------------------- 10 CLARK,MILLER,KING 20 SMITH,FORD,ADAMS,SCOTT,JONES 30 ALLEN,JAMES,TURNER,BLAKE,MARTIN,WARD SQL> ed 已写入 file afiedt.buf 1* select deptno部门号 ,wm_concat(ename)部门中员工的姓名 from emp group by deptno SQL> / select deptno部门号 ,wm_concat(ename)部门中员工的姓名 from emp group by deptno * 第 1 行出现错误: ORA-00904: "DEPTNO部门号": 标识符无效 SQL> select deptno ,wm_concat(ename)from emp group by deptno; DEPTNO ---------- WM_CONCAT(ENAME) -------------------------------------------------------------------------------- 10 CLARK,MILLER,KING 20 SMITH,FORD,ADAMS,SCOTT,JONES 30 ALLEN,JAMES,TURNER,BLAKE,MARTIN,WARD SQL> ed 已写入 file afiedt.buf 1* select deptno 部门号,wm_concat(ename) 部门中员工的姓名 from emp group by deptno SQL> / 部门号 ---------- 部门中员工的姓名 -------------------------------------------------------------------------------- 10 CLARK,MILLER,KING 20 SMITH,FORD,ADAMS,SCOTT,JONES 30 ALLEN,JAMES,TURNER,BLAKE,MARTIN,WARD SQL> set linesize 200 SQL> col 部门中员工的姓名 for a60 SQL> select deptno 部门号,wm_concat(ename) 部门中的员工姓名 from emp group by deptno; 部门号 ---------- 部门中的员工姓名 ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- 10 CLARK,MILLER,KING 20 SMITH,FORD,ADAMS,SCOTT,JONES 30 ALLEN,JAMES,TURNER,BLAKE,MARTIN,WARD SQL>
最后的格式
Oracle高级查询
62884 学习 · 144 问题
相似问题