I have a table like this (of course there are many more values but you get the idea):
ID Name
--- ----
1 A
1 B
2 C
3 D
4 A
4 D
4 E
4 F
4 G
4 H
I want to write a query that would output this, given that an ID cannot have more than 6 names.
ID Name1 Name2 Name3 Name4 Name5 Name6
--- ------ ------ ------ ------ ------ -----
1 A B
2 C
3 D
4 A D E F G H