Trying to find some simple SQL Server PIVOT examples. Most of the examples that I have found involve counting or summing up numbers. I just want to pivot some string data.
If you specifically want to use the SQL Server PIVOT function, then this should work, assuming your two original columns are called act and cmd. (Not that pretty to look at though.)
SELECT act AS 'Action', [View] as 'View', [Edit] as 'Edit'
FROM (
SELECT act, cmd FROM data
) AS src
PIVOT (
MAX(cmd) FOR cmd IN ([View], [Edit])
) AS pvt