8. A memory device storing computer program instructions that, when executed by a processor of a computer, cause the computer to perform a computer-implemented method comprising: receiving a query including: a selected record, an outer join that provides a joined table having NULLab 1 e records, and an Order By clause that provides a sort order for ordering records in the joined table based on one or more fields of the joined table; and generating, by the server, a separate query configured to fetch from the joined table a current row that corresponds to the selected record and either subsequent rows or previous rows relative to the current row, wherein generating the separate query comprises: determining whether a paging direction of the separate query is forward paging or backward paging, determining whether the sort order for the Order By clause is ascending or descending, determining an original inequality operator based on the sort order for the Order By clause and the paging direction of the separate query, determining whether the current row returns a NULL value, and generating a WHERE condition for the separate query configured to either change the original inequality operator or ignore the original inequality operator depending on whether the paging direction of the separate query is forward paging or backward paging, whether the sort order for the Order By clause is ascending or descending, and whether the current row returns a NULL value.
13. The memory device of claim 8 , wherein: the original inequality operator is changed to include an OR FIELD IS NULL condition when the paging direction of the separate query is backward paging, the sort order for the Order By clause is ascending, and the current row returns only non-NULL values.