I have two tables : T1 and T2 As below-- T1: ID | Age 1 | 22
2 | 23
3 | 24 T2: 22, 23, 24 are column names. ID | 22 | 23 |24
1 | 10 | 50 | 120
2 | 20 | 60 | 130
3 | 30 | 70 | 220 Now I need to create a third table as : Based on Age and ID of table 1, value in column is to be selected and column Dev is to be populated. Here column selection is done based of the row value of age in table 1. Therefore answer would be: ID | Age| Dev 1 | 22 | 10
2 | 23 | 60
3 | 24 | 220 For More Understanding: You see T1, ID = 1 has Age = 22 Cross reference T2, where Row = 1(ID from T1) and Column = 22 (Age from T2), therefore answer = 10.
... View more