how to get enames with comma seperated values by deptwise
on emp table?
Answer Posted / kavitha nedigunta
SELECT deptno ,
LTRIM(MAX( SYS_CONNECT_BY_PATH (
ename, ',')),',') EMP_STRING
FROM
(SELECT empno , ename, deptno,
row_number() OVER ( PARTITION BY deptno ORDER
BY rownum) rn
FROM EMP )
CONNECT BY deptno = PRIOR deptno
AND rn = PRIOR rn+1
START WITH rn =1
GROUP BY deptno
ORDER BY deptno;
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is synchronized subquery?
Whis is not false in primary key?
How do I truncate a sql log file?
Is id a reserved word in sql?
Is oracle sql free?
What is sqlite used for?
what is sp_pkeys? : Transact sql
How insert into statements in sql?
what are the different type of normalization? : Sql dba
What is sql and explain its components?
What is a mutating table and a constraining table?
Explain unique key in sql.
List the ways to get the count of records in a table?
What is data profiling in sql?
What do you understand by case manipulation functions?