title: ORA-00907: missing right parenthesis
body: <p>I'm getting the error " ORA-00907: missing right parenthesis"
  but I've checked and all the parenthesis are there, so I'm stumped.</p>
  
  <p>My query is</p>
  
  <pre><code>SELECT 
    SUM(score) as score, 
    facebook_id, 
    firstname, 
    lastname, 
    dense_rank(score) 
  WITHIN GROUP ( ORDER BY score ) as rank_db  
  FROM 
    (
      SELECT DISTINCT *
      FROM 
        (
          SELECT *  
          FROM fanta_score 
          ORDER BY score desc
        ) as f 
      GROUP BY 
        facebook_id, game_id
    ) as g 
  GROUP BY facebook_id
  ORDER BY score DESC, created_at
  LIMIT 50 
  </code></pre>
  
  <p>I'm by no means an Oracle expert, but I have to use it due the hosting environment its has to be in.</p>