Search code examples
sybase

limit and offset not working in sybase 15.7


I want to implement pagination. I tried following query Below query will display clients from 11 to 20 *SELECT * FROM Client ORDER BY ClientName DESC LIMIT 11,10;*

But it is giving following Error:: Error: Incorrect syntax near 'LIMIT'. SQLState: 42000 ErrorCode: 102

My Sybase version is

Adaptive Server Enterprise/15.7/EBF 21153 SMP SP100 Please let me know any alternative.


Solution

  • Sybase 15.7 does not support LIMIT and OFFSET. Some people have implemented a workaround to generate an artificial row count sequence to allow for easier pagination.

    Sybase offset for pagination

    How can I do paging in Sybase without making temp table? (oracle rownum issue)

    Sybase Reference Manual: Commands: Select Sybase Transact SQL Users Guide