So lets suppose i have this in DB:
a,b,c,d,e,f (ordered by date)
And i want to fetch them in order by date and get only the last 2 in every request
So i would get: e,f
The problem is that if i use the fetchLimit, I get the first ones of my ordered fetch not the last ones. I could calculate the offset every time the NSFRC changes. Also i need to use a NSFRC.
Does any one knows a better solution?
In SQL my query would be:
select * from (select * from tblmessage order by sortfield ASC limit 10) order by sortfield DESC;
This is what i want but for IOS: Android SQLite Query - Getting latest 10 records