Converting rows to single column:
create table emp ( empno number, empname varchar2(100), deptno number);
insert into emp values( 1, 'emp1', 10);
insert into emp values( 2, 'emp2', 20);
insert into emp values( 3, 'emp3', 30);
insert into emp values( 4, 'emp4', 10);
insert into emp values( 5, 'paresh', 30);
insert into emp values( 6, 'martin', 30);
insert into emp values( 7, 'sri', 10);select deptno,
rtrim (xmlagg (xmlelement (e, empno || ',')).extract ('//text()'), ',') list_of_empnos
from emp
group by deptno ;