Tuesday, May 8, 2012

dynamic pivot with join

I have 2 tables.
Table1



Id  MonthlySalaryXId    SalaryComponentXId  ComponentValue
1973 158 216 0
1974 158 217 0
1975 158 213 50000
1976 158 214 30000
1977 158 215 6000


and table2



Id  Component   SalaryComponentTypeXId
213 basic pay 3
214 HRA 3
215 pf 4
216 bonus 1
217 Incentive 1


I want to get the component from table2 as dynamic entry and for each component i need to get componentvalue table1
Example like this



Basic    HRA        PF     
50000 30000 6000


Please help me to do this work. I am in trouble in not completing this. Please help me.
Please anyone help me to solve this.





No comments:

Post a Comment