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 / pradeep

select deptno,cursor (select ename ,deptno from emp where
d.deptno = deptno ) from dept d

1* select deptno,cursor (select
SQL> /

DEPTNO CURSOR(SELECTENAME,D
---------- --------------------
10 CURSOR STATEMENT : 2

CURSOR STATEMENT : 2

ENAME DEPTNO
---------- ----------
CLARK 10
KING 10
MILLER 10

20 CURSOR STATEMENT : 2

CURSOR STATEMENT : 2

ENAME DEPTNO
---------- ----------
PORT NO 20
SMITH 20
JONES 20
SCOTT 20
ADAMS 20
FORD 20

6 rows selected.

30 CURSOR STATEMENT : 2

CURSOR STATEMENT : 2

ENAME DEPTNO
---------- ----------
ALLEN 30
WARD 30
MARTIN 30
BLAKE 30
TURNER 30
JAMES 30

6 rows selected.

40 CURSOR STATEMENT : 2

CURSOR STATEMENT : 2

no rows selected

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention what problem one might face while writing log information to a data-base table in pl/sql?

1158


Is sql a backend language?

1037


What are the various restrictions imposed on view in terms of dml?

907


List the ways to get the count of records in a table?

851


How to use distinct and count in sql query? Explain

959


What are some emotional triggers?

927


Can a view be mutating? If yes, then how?

959


Why do we use function in pl sql?

1005


What is difference between inner join and self join?

1028


what is a database transaction? : Sql dba

1104


How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?

1034


can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba

941


Is a table valued function object?

958


What is sqlerrd?

921


How do I add a primary key to a table?

970