Skip to Main Content

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
Post Details
Added on Jun 10 2021
4 comments
243 views