troubleshooting Question

Rows to Columns

Avatar of TvMpt
TvMptFlag for Portugal asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008Databases
8 Comments1 Solution449 ViewsLast Modified:
Hi.
I have this sample tables
Table A
Field1  | FK Table2
Name1      | 10
Name2      | 20
Name2      | 30
Name3      | 10
Name2      | 20

Table B
Field1  | Field 2
10      | TTT
10      | XXX
20      | TTT
10      | ZZZ
30      | TTT

And i want to obtain a table with table b rows as columns
something like this

Table

Name1      | TTT | XXX | ZZZ
Name2      | TTT |     |
Name2      | TTT |     |
Name3      | TTT | XXX | ZZZ
Name2      | AAA |     |
ASKER CERTIFIED SOLUTION
ralmada

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros