Pivot without aggregate function or Row to Columns by group in Oracle
<p>I am trying to transform rows to columns by type of row.<br>
Here given Table_1 <a href="https://i.stack.imgur.com/3S8PO.jpg" rel="nofollow noreferrer">Table_1</a></p>

<pre><code>           Table_1
CITY            AMOUNT      TYPE_ID
Moscow         158000          1
New York       94500           1
Moscow         1478000         2
Los Angeles    162000          2
New York       5500000         2
Los Angeles    35400           1
Moscow         741200          1
</code></pre>

<p>and with select script in result I want to take like in Table_2 <a href="https://i.stack.imgur.com/ug28k.jpg" rel="nofollow noreferrer">Table_2</a></p>

<pre><code>            Table_2
CITY           TYPE_1_AMOUNT       TYPE_2_AMOUNT
Moscow           158000               1478000
Moscow           741200                  NULL
New York         94500                5500000
Los Angeles      35400                162000
</code></pre>

<p>I tried with PIVOT. but there must be aggregate func.<br>
Aggregate function MAX() retrieves just max amount... </p>