This is too big to put in a comment, so adding it in answer section
i think you are referring to this SQL code.
SELECT Action,
[View] = (Select view_edit FROM tbl WHERE t.action = action and view_edit = 'VIEW'),
[Edit] = (Select view_edit FROM tbl WHERE t.action = action and view_edit = 'EDIT')
FROM tbl t
GROUP BY Action
Here correlated subquery is used instead of MAX aggregation or pivot
keyword
for each action in the table , the corresponding view_edit value is fetched in the correlated sub query , if corresponding action is not found then it will have NULL
To understand more remove group by
and run the query and you will understand the correlated subquery and the need for group by