Server side pagination - Offset and Limit

0
Hi Everyone! I am using external DB connector to retrieve large amount of data. Anyhow I achieved the same but I need to implement server side pagination. If I tried to set offset and limit in the SQL query it is throwing error like below. If Anyone could help me out in this it would be helpful. Thanks in advance!
asked
2 answers
0

The error may be due to the specific SQL database you're using, as different databases have slightly different syntax for pagination. 

For Postgres,

SELECT * FROM TableName ORDER BY column DESC OFFSET 1 LIMIT 10;

For SqlServer,

SELECT * FROM TableName ORDER BY column DESC OFFSET 1 ROWS FETCH NEXT 10 ROWS ONLY;

 

answered
0

Hey Mohamedbeemubeen N,

It's depend of which database you use, syntax will be different

e.g. oracle-OFFSET 10 ROWS FETCH NEXT 20 ROWS ONLY 

since you are using MySql it's should be

SELECT * FROM `members` LIMIT 1, 2;

https://community.mendix.com/link/space/deployment/questions/136799

Best regards, Slavko

answered