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

What is a behavioral trigger?

961


Is it possible to remove child records without removing master table records...the two having pk,fk relationship?

1246


What is the difference between database trigger and stored procedure?

1059


Which software is used for pl sql programming?

970


What is difference between primary and secondary key?

1009


How many sql commands are there?

1102


What is the difference between clustered and non-clustered index in sql?

987


Can we insert data into view?

891


What is meant by user defined function?

1028


Does sql require a server?

994


What is data types in sql?

983


What is string join?

962


Mention what does the hierarchical profiler does?

1066


What is percent sign in sql?

1266


What is scope and visibility in PL/SQL?

1179