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
How long will it take to learn pl sql?
How many types of tables are there?
How to change the order of columns in Oracle SQL Plus ?
What version is sql?
Is it possible to sort a column using a column alias?
What is the difference between left join and right join?
Can we change the table name in sql?
How to use sql statements in pl/sql?
How do I remove duplicates in two columns?
How do you create a unique index?
Write an sql query to select all records from the table?
What are local and global Indexes and where they are useful.
What program will open a mdb file?
which tcp/ip port does sql server run on? : Sql dba
Why is the cursor important?