Query not producing desired results
<p>Below is the table structure of my table - group_table</p>

<p><a href="https://i.stack.imgur.com/hNI2A.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hNI2A.jpg" alt="enter image description here"></a> </p>

<p>The result I need should be as below</p>

<p><a href="https://i.stack.imgur.com/S2kvu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S2kvu.jpg" alt=""></a></p>

<p>Below is the query I tried using. But not producing the result as desired.</p>

<pre><code>SELECT * FROM 
(
SELECT A.PARENTID,A.NAME,A.CAPTION,A.PMKID,A.MKTPLANID,A.CATEGORY
FROM GROUP_TABLE A
)P
PIVOT
(
MAX(NAME)
FOR CAPTION IN ([Rollup],[Appeal Category],[PME])
)S
</code></pre>