Look at my paginate post and you can get code that does this, without changing any querys. Maybe it should be made into a proc or plsql function. I will look into this later.