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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Combining multiple rows to get a single one

User_UJ80KJun 10 2021 — edited Jun 10 2021

Source table :
--------------------------------------------------
| Employee Name | department | Emp Id |
--------------------------------------------------
| Sam | Sales | 101 |
--------------------------------------------------
| Sam | Finance | 101 |
--------------------------------------------------
| Dirk | marketing | 102 |
--------------------------------------------------
| Dirk | Research | 102 |
--------------------------------------------------

Output needed :

--------------------------------------------------------------
| Employee Name | Emp Id | department1 | department2|
--------------------------------------------------------------
| Sam | 101 | Sales | Finance |
--------------------------------------------------------------
| Dirk | 102 | marketing | Research |
-------------------------------------------------------------

Can you kindly help me with what functions or query should I use to get above mentioned output?

Comments

Processing

Post Details

Added on Jun 10 2021
4 comments
1,446 views