The SOQL Pagination feature is now generally available in Summer ’12. This feature includes the new OFFSET clause used in Salesforce Object Query Language (SOQL) queries. What exactly does OFFSET do, you might be wondering?
OFFSET lets you specify a number of rows to skip in the returned data. So, for example if a SOQL query returns 1000 records (determined by using the COUNT() SOQL function) and you only want to see the last 50, you can add “OFFSET 950” to the end of your SOQL query:
SELECT Name FROM MyObject__c ORDER BY Name OFFSET 950
Where… Continue reading