I want to create a pivot report (Department wise sum salary). I need to use sub_query in pivot. XML cannot be used here.
Example:
SELECT * FROM
( SELECT DEPARTMENT_ID,SALARY
FROM EMPLOYEES
)
PIVOT
(SUM(SALARY) FOR DEPARTMENT_ID IN (SELECT DISTINCT DEPARTMENT_ID FROM EMPLOYEES)
)
afzal
FOR DYNAMIC PIVOT QUERY--
SEE THIS ARTICAL--https://technology.amis.nl/oracle/dynamic-sql-pivoting-stealing-antons-thunder/
Shimul
Thank you. But It Does not work properly.