title: Oracle pivot query results in a "command not properly ended" error
body: <p>When firing the following query to a 10g Oracle database:</p>
  
  <pre><code>    SELECT * FROM (
          SELECT T1.ID, T2.ACCT_NO, ROW_NUMBER() OVER (PARTITION BY T1.ID ORDER BY T1.ID DESC) AS RRRRRRR 
          FROM TABLE1 T1
          INNER JOIN TABLE T2 ON T1.ID = T2.ID
          WHERE T1.ID = 666
      )
      PIVOT (MIN(T1.ID) AS ALIAS1 FOR RRRRRRR IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
  </code></pre>
  
  <p>I get an "command not properly ended" error.
  I've searched for Oracle pivot examples and they all pretty much showed the same example.
  What am I missing here?</p>