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) )
Discy Latest Questions
Department wise Employee Report. For IT Department: Employee_Id,Last_Name,Hire_date,Salary Column will Show. Other Column will be Hidden. For HR Department: Employee_Id,Salary Column will Show. Other Column will be Hidden. I want it will be show Hide from the database. For this Reason i created a Setup Employee Table and I have written a code in each item in server condition-> Plsql Function Body. Example: For Last Name Column: ======================= Declare V_LAST_NAME VARCHAR2(50); begin if :P443_TEST_NO is not null then select LAST_NAM into V_LAST_NAM from SET_EMPLOYEES where DEPARTMENT_ID=:P443_DEPARTMENT_ID; if V_LAST_NAME = '1' then return true; else return false; end if; end if; end; For Salary Column: ======================= Declare V_SALARY VARCHAR2(50); begin if :P443_TEST_NO is not null then select LAST_NAM into V_SALARY from SET_EMPLOYEES where SALARY_ID=:P443_SALARY; if V_SALARY = '1' then return true; else return false; end if; end if; end; But the problem is that I feel different Server Side Condition (Plsql Function Body) in each column.I want to do it by a function/Procedure. How Can i Do it?