how to get enames with comma seperated values by deptwise
on emp table?
Answer Posted / amitabha mandal
COLUMN employees FORMAT A50
SELECT deptno, wm_concat(ename) AS employees
FROM emp
GROUP BY deptno;
DEPTNO EMPLOYEES
---------- -------------------------------------------------
-
10 CLARK,KING,MILLER
20 SMITH,FORD,ADAMS,SCOTT,JONES
30 ALLEN,BLAKE,MARTIN,TURNER,JAMES,WARD
3 rows selected.
check tyhis link :http://www.oracle-
base.com/articles/misc/StringAggregationTechniques.php
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is sql exception?
What is difference between stored procedures and application procedures?
How exception handling is done in advance pl/sql?
What is a boolean in sql?
Where can I learn sql for free?
Can we connect to postgresql using sql developer?
How do I remove all records from a table?
what is union? : Sql dba
What are sql procedures?
what is the difference between where clause and having clause? : Sql dba
How can you create an empty table from an existing table?
How do you rank data in sql?
What are basic techniques of indexing?
Where not exists in sql?
how to run 'mysql' commands from a batch file? : Sql dba