title: Alternative to SQL window functions in Sybase
body: <p>I am working on Sybase Adaptive Server Enterprise (version 12.5.0.3). Trying to use <code>Row_number() OVER (Partition by columnname order by columnname)</code>. When I execute the query it is throwing an exception saying that the syntax near OVER is incorrect. I have searched for proper row_number() syntax for sybase database, but there is nothing wrong in the syntax. I guess that the Sybase version that am using does not support <code>row_number() OVER</code>. I even tried <code>dense_rank() OVER</code>, but am getting the same error. </p>
  
  <p>I need to know whether it is really a syntax issue or its because of Sybase's low version which is not supporting the key words? </p>
  
  <p>If the issue is with the version, then is there any alternative for row_number OVER and dense_rank() OVER for sybase database. </p>
  
  <p>My Query:</p>
  
  <pre><code>select  cr.firstname, cr.lastname, cr.dob,cr.phone,
            row_number() over (patition by cr.dob order by createddate) "rank"       
            from ff.CrossReferenceTable cr
  </code></pre>
  
  <p>Error Message: </p>
  
  <pre><code>Server Message:  Number  156, Severity  15
                 Server 'MyServer', Line 1:
                 Incorrect syntax near the keyword 'over'.
  </code></pre>