Here is my query:
select
t1.id
,t1.name
,t3.description
,t3.amount
from
table1 (nolock) t1
join
table2 (nolock) t2 on t1.t2_id = t2.id
join
table3 (nolock) t3 on t2.t3_id = t3.id
Results:
t1.id | t1.name | t3.description | t3.amount
------+----------+-----------------+----------
1 | TEST | TEST DESC. 1 | 100
1 | TEST | TEST DESC. 2 | 200
What I want my results to be:
t1.id | t1.name | TEST DESC. 1 | TEST DESC. 2
------+----------+---------------+--------------
1 | TEST | 100 | 200
The values in t3.description will not always be the same. There could be many different ones.
I've been trying to look into Pivots but I can't seem to wrap my head around it. The query I provided is a very simplified version of a much larger query but if I can get this to work I should be able to make it work for the larger query.
Thanks everyone for the suggestions.