My apologies, as I know this is a question that's been answered many times in various contexts. However, after an hour of trying and failing to adapt the examples I've found to my needs, I'm at the conclusion that I'm an idiot, and need help specific to my data...

I have a view that returns data as follows:

```
SELECT *
FROM vwPersonMainContactDetails
```

Output:

```
PersonID | ContactMethod | ContactValue
----------+-----------------+-----------------
1 Email [email protected]
1 Mobile 07777 777777
2 Email [email protected]
2 Mobile 07766 666666
3 Email [email protected]
3 Mobile 07755 555555
```

What I need is to return the data structured as follows:

```
PersonID | Mobile | Email
----------+----------------+--------------------------
1 07777 777777 [email protected]
2 07766 666666 [email protected]
3 07755 555555 [email protected]
```

Can anyone help? I know that PIVOT will be the answer, but I'm really struggling to make it work for me...

Thanks a lot

Andrew