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!

transform 2 rows into 1 row

Gor_MahiaAug 17 2022

Hi,
ive EMP table as below with dataset.
i want to come up with a query that takes any employee with the manager and transform those 2 rows into one (kinda like pivot) as below:

image.pngFOr instance consider Clark whose supervisor is King (president)
expected output:
ENAME SUPERVISOR_NAME ENAME_JOB SUPERVISOR_JOB ENAME_SAL SUPERVISOR_SAL
=======================================================================
CLARK KING MANAGER PRESIDENT 2450 5000
Any idea on a good query with excellent performance?
Using 11g & 12g.

thanks

This post has been answered by Frank Kulash on Aug 17 2022
Jump to Answer
Comments
Post Details
Added on Aug 17 2022
3 comments
119 views