select * from (select emp_code,emp_name,Allowance_Name,Allwance_Amount from V_Acquintance_role where emp_code='E004') s pivot (max(Allwance_Amount) for Allowance_Name in([ESI],[PF],[HRA],[Other Deduction]) ) pt this is running fine and i am getting the correct output also but, "([ESI],[PF],[HRA],[Other Deduction])" this thing is constant which i want to make dynamic meand the data will come from database by which i have used the following code but it is showing error. select * from (select emp_code,emp_name,Allowance_Name,Allwance_Amount from V_Acquintance_role where emp_code='E004') s pivot (max(Allwance_Amount) for Allowance_Name in(select Allowance_Name from dbo.tbl_Allowance_Master) ) pt
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)