title: How to make dynamic pivot with date and another column in oracle?
body: <p>I have a table like this:</p>
  
  <pre><code> NAME          VALUE       IDENTIFIER          MYDATE
  NAME1           123           ATR            01/10/2018  
  NAME1           333           QTDE           01/10/2018  
  NAME2           212           ATR            01/08/2018  
  NAME2           123           QTDE           01/08/2018 
  NAME2           133           ATR            01/09/2018  
  NAME2           123           QTDE           01/09/2018  
  NAME3           678           ATR            01/08/2018  
  NAME3           123           QTDE           01/08/2018 
  </code></pre>
  
  <p>In <code>IDENTIFIER</code>, it will be only <code>ATR</code> or <code>QTDE</code>.<br>
  I need to make a pivot to get the <code>VALUE</code> of <code>QTDE</code> or <code>ATR</code> of every month so the result will be something like </p>
  
  <pre><code>NAME        QTDE08/2018        ATR08/2018        QTDE09/2018        ATR09/2018        QTDE10/2018        ATR10/2018
  NAME1           0                   0               0                   0                 333                123
  NAME2          123                 212             123                 133                 0                  0
  NAME3          123                 678              0                   0                  0                  0
  </code></pre>
  
  <p>I have tried to make the pivot, but I could only do with <code>IDENTIFIER</code> and I have no clue how to make it with the date as well</p>
  
  <pre><code>SELECT *
    FROM (SELECT ST.NAME,
                 ST.VALUE,
                 ST.IDENTIFIER,
                 TO_CHAR(TO_DATE(ST.MYDATE), 'MM/YYYY') AS MYDATE
            FROM SOME_TABLE ST
           WHERE ST.IDENTIFIER IN ('QTDE', 'ATR')) 
  PIVOT(SUM(VALUE)
        FOR IDENTIFIER IN ('QTDE' AS QTDE,
                           'ATR' AS ATR))
  </code></pre>
  
  <p>I edit the table and colunms name, it's not the original one from my table.</p>