snappydata
snappydata copied to clipboard
how to use offset in sql
I want to query data from snappydata using sql, like this: select * from tableA limit 10, 20; or select * from tableA limit 20 offset 10;
and find error.
Does snappydata not support offset ?
Hi Gary - OFFSET is not supported yet. We plan to bring it in at some point soon though we can't give you an exact date now.
“select * from (select row_number() over (order by id desc) rn, * from table) where rn between 1 and 10” it works 李刚大佬好🌚
this is likely quite expensive if the table is large. A better approach is to use monotonically_increasing_id() function to inject a id column into your table at load time. And, later use this to select the required range.
Jags SnappyData acquired by TIBCO http://snappydata.io Download binary, source https://www.snappydata.io/download
On Wed, Aug 28, 2019 at 12:28 AM 吴伟杰 [email protected] wrote:
“select * from (select row_number() over (order by id desc) rn, * from table) where rn between 1 and 10” it works 李刚大佬好🌚
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SnappyDataInc/snappydata/issues/1369?email_source=notifications&email_token=AAOYUBXVOJDLCFWI3DEG3ODQGYSIFA5CNFSM4IGCQNI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5KFDRQ#issuecomment-525619654, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOYUBVDUI7ZJ3JWYSP5EELQGYSIFANCNFSM4IGCQNIQ .