How to Group By using Month from date stored as millisecond Postgres
<p>I have a transaction table which contains <code>net_amount</code> field and <code>last_updated_time</code> field, where <code>last_updated_time</code> is stored as milliseconds. I need to get total amount group by using month, year or date. How can I do this in PostgreSQL?</p>

<p>My table looks like as below:</p>

<pre><code>+------------+-------------------+
| net_amount | last_updated_time |
+------------+-------------------+
| 100        | 1470286872831     |
+------------+-------------------+
| 200        | 1471594713801     |
+------------+-------------------+
| 300        | 1471594651335     |
+------------+-------------------+
</code></pre>

<p>and expecting result as:</p>

<pre><code>+----------+---------------+
| month    | sum_of_amount |
+----------+---------------+
| january  | 1000          |
+----------+---------------+
| february | 2000          |
+----------+---------------+
| ---      | ----          |
+----------+---------------+
</code></pre>