Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paging in Advantage Database

i'm creating a web app that's running on an Advantage Database server, not my personal weapon of choice but that's what the company uses. I have a couple of big lists that the end-users need to be able to view however i can't seem to find a way to page through the results in SQL.

Is there something like LIMIT / OFFSET for Advantage Database? If no, any suggestions on approaching this?

thank you in advance!

like image 697
UnreliableWitness Avatar asked Jan 22 '23 13:01

UnreliableWitness


2 Answers

I understand that LIMIT and a ROWNUM will be new features in an upcoming version of Advantage. http://feedback.advantagedatabase.com/forums/2671-general/suggestions/30213-return-query-specific-row-number-?ref=title

However, until then, I have used this in the past to select row 50-60.

select top 10 * from mytable where rowid not in (select top 50 rowid from mytable)

@tommieb75, you indicated that the SQL dialect was not standard. I have found that it is based on the standards containing most of the SQL-92 standard and some of the SQL-2003 features.

like image 126
Edgar Avatar answered Jan 31 '23 09:01

Edgar


Updating this for any stumbling here, but as Edgar mentioned in his answer, Advantage 10 SQL now supports a START AT keyword.

SELECT TOP 10 START AT 11 * FROM emp

See: devzone.advantagedatabase.com/dz/webhelp/Advantage10.1/master_limiting_query_results.htm

like image 30
Eric G Avatar answered Jan 31 '23 10:01

Eric G