How to achieve pivot output in Oracle
<p>Source is as following :</p>

<pre><code>NAME |SEX
-----+----
A    |MALE
B    |FEMALE
C    |MALE
D    |FEMALE
E    |MALE
</code></pre>

<p>Required output, pivoting the values in the second column as the headings, as following :</p>

<pre><code>MALE FEMALE
A     B
C     D
E
</code></pre>