Hi all.. I'm using MS SQL 2005 and am trying to take data that is in multiple rows and display it in a single row. I think my question can best be understood with an example. Here is what I have
Name Type Count
------- --------- -------
Host1 A 53
Host1 B 42
Host1 C 5
Host2 A 5
Host3 A 6
Host3 C 2
...
The "Type" will always be either A, B, or C. And I'd like to be able to get the data to come out like this via a view:
Name Type A Type B Type C
------ -------- ------ ------
Host1 53 42 5
Host2 5 NULL NULL
Host3 6 NULL 2
Anyone have any ideas of a view that would accomplish this??
Thanks!
Name Type Count
------- --------- -------
Host1 A 53
Host1 B 42
Host1 C 5
Host2 A 5
Host3 A 6
Host3 C 2
...
The "Type" will always be either A, B, or C. And I'd like to be able to get the data to come out like this via a view:
Name Type A Type B Type C
------ -------- ------ ------
Host1 53 42 5
Host2 5 NULL NULL
Host3 6 NULL 2
Anyone have any ideas of a view that would accomplish this??
Thanks!