I am working on Sybase Adaptive Server Enterprise (version 12.5.0.3). Trying to use Row_number() OVER (Partition by columnname order by columnname)
. 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 row_number() OVER
. I even tried dense_rank() OVER
, but am getting the same error.
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?
If the issue is with the version, then is there any alternative for row_number OVER and dense_rank() OVER for sybase database.
My Query:
select cr.firstname, cr.lastname, cr.dob,cr.phone,
row_number() over (patition by cr.dob order by createddate) "rank"
from ff.CrossReferenceTable cr
Error Message:
Server Message: Number 156, Severity 15
Server 'MyServer', Line 1:
Incorrect syntax near the keyword 'over'.