Hi ludoviko,
As per my understanding of you have the data like
EmpID DeptID
101 10
102 10
103 10
104 20
105 20
106 30
107 20
and want the out put like -
DeptID Emps
10 101,102,103
20 104,105,107
30 106
If my understanding about your question is correct, then it is more a sql query related question than a
jdbc related query.
In oracle you are use the following query to get the required result -
I hope this would resolve your query.