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?