I'm fairly new to TSQL and have an issue I hope you can help with!
My data is organized as follows:
+-------+-------+
| Name | Phone |
+-------+-------+
| John | xxx |
+-------+-------+
| John | yyy |
+-------+-------+
| Sally | www |
+-------+-------+
| Sue | qqq |
+-------+-------+
| John | aaa |
+-------+-------+
| Sally | ppp |
+-------+-------+
I would like it to come out after the transform as:
+-------+--------+--------+--------+
| Name | Phone1 | Phone2 | Phone3 |
+-------+--------+--------+--------+
| John | xxx | yyy | aaa |
+-------+--------+--------+--------+
| Sally | www | ppp | |
+-------+--------+--------+--------+
| Sue | qqq | | |
+-------+--------+--------+--------+
The issue I have been running into is, one 'Name' has an undefined number of 'Phones'. Some may have one while others could have 10.
Thanks guys, appreciate any help you can give me.
William.