iahmad, i understand what you said about "the result set is being build with combination of tables" but if you think about it for a minute, the result set is just a table, right?
so, what is the primary key of this table?
for example, if you had a query to return authors and books, where each author can have multiple books, and each book could be written by multiple authors, the result set might be
Code:
aid authorname bookISBN booktitle
34 Celko, Joe 1874416508 Instant SQL Programming
34 Celko, Joe 1558605762 SQL For Smarties
34 Celko, Joe 1558604537 SQL Puzzles and Answers
47 Forta, Ben 078971809x CF4 Web Application Kit
47 Forta, Ben 0789718103 Advanced CF4 App Dev
in this example, the result set has a primary key of aid plus bookISBN
so when you return the first 10, save the primary key in variables, and use these variables when you query the second time
select ... from ...
where authorid >=
variable
and bookISBN >=
variable
order by authorid, bookISBN
how you limit the number of records returned to 10, however, is a separate problem that depends on your database -- sql/server and access use TOP, mysql and postgresql use LIMIT, i'm not sure what oracle uses...
rudy
http://rudy.ca/