title: Incorrect syntax near the keyword 'DESC'
body: <p>I'm trying to write an SQL query but when I try to save it throws me an incorrect syntax error.
  Here's the query:</p>
  
  <pre><code>(
  @top int,
  @bottom int
  )
  
  AS
          SELECT *
          FROM (SELECT top (@bottom - @top + 1) *
              FROM (SELECT top (@bottom) *
                    FROM    tblPlayers INNER JOIN
                            tblPosition ON tblPlayers.IDPosition = tblPosition.IDPosition INNER JOIN
                            tblTeams ON tblPlayers.IDTeam = tblTeams.IDTeam
                    ORDER BY (PPG DESC, APG DESC, RPG DESC)
                   )
              ORDER BY PPG ASC, APG ASC, RPG ASC
               )      
          ORDER BY PPG DESC, APG DESC, RPG DESC
      RETURN
  </code></pre>
  
  <p>The problem is with the most inner ORDER BY. Without it's brackets it gives an incorrect syntax near the keyword 'ORDER'. With the brackets the error is incorrect syntax near the keyword 'DESC'. 
  I'm out of ideas. The syntax seems fine to me.
  Thanks in advance.</p>