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
Mention what problem one might face while writing log information to a data-base table in pl/sql?
Is sql a backend language?
What are the various restrictions imposed on view in terms of dml?
List the ways to get the count of records in a table?
How to use distinct and count in sql query? Explain
What are some emotional triggers?
Can a view be mutating? If yes, then how?
Why do we use function in pl sql?
What is difference between inner join and self join?
what is a database transaction? : Sql dba
How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?
can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba
Is a table valued function object?
What is sqlerrd?
How do I add a primary key to a table?