have one table called A and the data is like below:
TaskId  Activity TestData
111     ACT1     X
111     ACT2     Y
111     ACT3     Z
have one more table called B and data like below:
Activity   Comments
ACT1       CM1
ACT2       CM2
ACT3       CM3
need the result to be displayed like below , in which comments column is dynamic data.
TaskId  ACT1  Comments  ACT2   Comments  ACT3   Comments
111     X     CM1       Y      CM2       Z      CM3