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 a behavioral trigger?
Is it possible to remove child records without removing master table records...the two having pk,fk relationship?
What is the difference between database trigger and stored procedure?
Which software is used for pl sql programming?
What is difference between primary and secondary key?
How many sql commands are there?
What is the difference between clustered and non-clustered index in sql?
Can we insert data into view?
What is meant by user defined function?
Does sql require a server?
What is data types in sql?
What is string join?
Mention what does the hierarchical profiler does?
What is percent sign in sql?
What is scope and visibility in PL/SQL?