title: How can I use OVER and ORDER BY
body: <p>I can't understand this code's bug.</p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>SELECT
      CariID, HesapID, BTrh, BCinsiID, BNo, Acklm, VdTrh, mTrh, BorcT, AlacakT, 
      SUM(BorcT) OVER (PARTITION BY CariID, HesapID ORDER BY BTrh, BNo, mTrh) AS TopBorcT, 
      SUM(AlacakT) OVER (PARTITION BY CariID, HesapID ORDER BY BTrh, BNo, mTrh ) AS TopAlacakT
  FROM
      tCariH
  </code></pre>
  
  <p><strong>ERROR:</strong></p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Line 3</p>
    
    <p>Incorrect syntax near 'order'.</p>
  </blockquote>