Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How does a covering index work?

971


Is sql a scripting language?

1024


What do you understand by exception handling in pl/sql?

1040


Explain select statements in sql?

1063


What is a sql statement?

975


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

967


What does select * from mean in sql?

3251


What is data type in sql?

974


How to create a menu in sqlplus or pl/sql?

1131


How do I run sql profiler?

1077


What is the difference between an inner join and an outer join?

1033


Can one improve the performance of sql*loader? : aql loader

1055


Which kind of parameters cannot have a default value in pl sql?

1157


How do I get sql certification?

978


What is sql profiler in oracle?

1101