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
Can we insert data in view?
What is update query?
What is an emotional trigger?
What is sequence in sql?
How do you use collections in procedure to return the resultset?
Is a view faster than a stored procedure?
What is a Mapplet?
What is crud diagram?
Can we use update in sql function?
Can you join a table to itself?
what are the performance and scalability characteristics of mysql? : Sql dba
What are the types of subqueries?
What is an exception in PL/SQL? What are the two types of exceptions?
Can we create table inside stored procedure?
What is sql analyzer?