Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting a GROUP_CONCAT Query of MySQL to Oracle

653361Oct 31 2010 — edited Nov 5 2010
Hello All,
We are migrating our MySQL Database to Oracle and we are facing the GROUP_CONCAT in built function of MySQL.
I have gone through the WM CONCAT, COLLECT AND other functions built from the Oracle aggregate packages . Our problem is this:
table A(emp_number, emp_firstname, emp_lastname, emp_status) and table B(emp_reporting_mode, emp_sub_mode, emp_sup_mode); Here emp_sup_mode represents the the employee
Those tables are not related and we have such data
Table A
emp_number emp_firstname emp_lastname emp_status
5 Raoul ESSOME STA000
6 Nadine YAYA NULL
1 Hermann LONDJI STA001
14 Honore ONANA STAT00

Table B
emp_reporting_mode emp_sup_mode emp_sub_mode
1 6 1
1 14 5
The emp_sup_mode represents the supervisor emp_number and emp_sub_mode represents the subordinate emp_number. MySQl was able to use the GROUP_CONCAT to concatenate this.
is as such and should output the emp_firstname and the emp_lastname of the supervisor where the supervisor code is the equivalence of the employee number. Here, we can see Nadine YAYA (emp_number 6) is the supervisor to Hermann LONDJI (emp_number 1) and Honore ONANA (emp_number 14) is the supervisor to Raoul ESSOME (emp_number 5).
Thanks for any input. Other methods and fuctions rather aggregate from similar id and cos.
This post has been answered by Solomon Yakobson on Oct 31 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 3 2010
Added on Oct 31 2010
19 comments
3,238 views