Create view with fields from another table as column headers
I've got two tables that I'd like to combine into a view.
The first table contains the structure:
PhoneNumberType PhoneNumberTypeName
101 Mobile
102 Home
103 Work
The second table contains the actual data that will be stored, and the columns reference the ID of the first table:
PhoneNumberType PhoneNumber PersonId
101 90354351 1001
102 98345634 1001
103 92345123 1002
What I'd like to get as a result in a view:
Mobile Home Work PersonId
9035435 98345634 Null 1001
Null Null 92345 1002
Basically I would like to combine 2 tables and create a view.